Logo

dev-resources.site

for different kinds of informations.

Prelude to react-hook-use-cta (useCTA)

Published at
3/14/2024
Categories
react
reacthook
typescript
hooks
Author
Rafael De Leon
Categories
4 categories in total
react
open
reacthook
open
typescript
open
hooks
open
Prelude to react-hook-use-cta (useCTA)

Introduction

In the past, I found myself writing a React.useReducer hook that did common patterns of updating, setting, or comparing my current state with previous or initial state. Instead of having to rewrite this hook everywhere I went, I decided to turn it into a hook library in case I needed it in other projects.

It's current version is in prerelease version 0.0.1 since I think the Typescript and some of the API could be improved.

I provided extensive documentation on the hook's API in the README.md and provided a Demo playground for people to see the hook in action.

I did what I could to help intelli-sense through Typescript when it comes to defining custom actions and dispatch parameters.

I want to send this out into the wild to see if it helps and get some input. Thanks for reading.

Featured ones: