Open C-3PFLO opened 1 year ago
Try doing everything with hooks instead of a separate redux implementation. Maybe more complex apps will still need redux, but use this simpler app to get a feel doing things just with hooks.
most uses of React hooks should be encapsulated in a custom hook
https://kyleshevlin.com/use-encapsulation
how many of the hooks end up being project-agnostic like logging in, checking account info, getting collection info, etc? Can these be bundled into an npm package like fcl-hooks?
Anything in here also needed in our all is a good bet to be commonly needed:
https://github.com/onflow/kitty-items/tree/master/web/src/hooks
Any state shared across components should follow this useContext pattern with custom hooks
Looks like someone made it: https://www.npmjs.com/package/@onflow/fcl-react/v/0.0.0
but it’s 0.0.0 and has 0 downloads?
UPDATE: asked in discord and they marked it as deprecated.
but this one was approved for a grant: https://github.com/maggo/use-flow
If using context (app or account?) need to handle re-rendering of children. See here: https://youtu.be/CDGBTjMBJzg
Client-side state implementation, up to the point of the FCL requests
Review patterns in https://github.com/onflow/kitty-items/tree/master/web/src, but consider keeping Redux for state