Thanks for your comment 🤩, First of all, you have to think about what the context is used for. Mainly the context in react is used for sharing some "global" data to avoid passing that data as props through a lot of components. if you are thinking use context to manage the state of your app to avoid using redux it's not a very recommended practice. saying this from the hexagonal architecture perspective, to use context should be enough adding some repos and use cases to grab some data from your domain. Remember the use of context is highly risky in terms of code coupling, and that coupling is one of the primary goals when we are using DDD in this case Hexagonal architecture, a better approach is to use component composition and manage the state separately.
@esaraviam
thank you so much for your thorough response. Definitely helpful! Will take your advise into consideration. Thanks for sharing your knowledge.
Best,
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for your comment 🤩, First of all, you have to think about what the context is used for. Mainly the context in react is used for sharing some "global" data to avoid passing that data as props through a lot of components. if you are thinking use context to manage the state of your app to avoid using redux it's not a very recommended practice. saying this from the hexagonal architecture perspective, to use context should be enough adding some repos and use cases to grab some data from your domain. Remember the use of context is highly risky in terms of code coupling, and that coupling is one of the primary goals when we are using DDD in this case Hexagonal architecture, a better approach is to use component composition and manage the state separately.
I Hope to be Helpful
@esaraviam thank you so much for your thorough response. Definitely helpful! Will take your advise into consideration. Thanks for sharing your knowledge.
Best,