DEV Community


Discussion on: React Context with useReducer and Typescript.

elisealcala profile image
Elizabeth Alcalá Author

oh. maybe you can pass the function through the context to the reducer? I'm going to try it and if I'm able to do it, I'll share the code :)

Thread Thread
utshp08 profile image

Yup, looking forward to it. That is what I wanted to achieve, I saw also in hooks document that we can create an init function that can be call through dispatch, however, not yet tried it.