codeforsanjose / SJPL-MealTally

Web app to help San Jose public libraries coordinate free community meals.
GNU General Public License v3.0
9 stars 9 forks source link

Context API integration #61

Open JMStudiosJoe opened 6 years ago

JMStudiosJoe commented 6 years ago

maybe not yet but reviewing this blog https://www.valentinog.com/blog/react-redux-tutorial-beginners/

thedocbwarren commented 6 years ago

How about this as an alternative:

https://reactjs.org/docs/context.html

https://medium.com/dailyjs/reacts-%EF%B8%8F-new-context-api-70c9fe01596b

https://medium.freecodecamp.org/replacing-redux-with-the-new-react-context-api-8f5d01a00e8c

JMStudiosJoe commented 6 years ago

Ah I heard about this yes will look into it. But for now need to determine if we need it yet or not and I’m think long we don’t need it yet. What are your thoughts @thedocbwarren ?

Sent with GitHawk

thedocbwarren commented 6 years ago

I don’t think so yetbas there aren’t a lot of components. Context and and some cool patterns can help keep things neat and don’t require redux or difficult property passing.

JMStudiosJoe commented 6 years ago

closing issue since not needed yet

JMStudiosJoe commented 6 years ago

ok so think i have hit the mark where I need redux or something. When viewing a report and user wants to edit it from the modal which is quite a few components deep from MealTallyComponent so is https://reactjs.org/docs/context.html what the cool kids on the block are using these days? @thedocbwarren

JMStudiosJoe commented 6 years ago

I see their example passing a simple string but what about an object or function like editReport which takes a report object then just goes to the MealTallyComponent?

JMStudiosJoe commented 6 years ago

Turns out users will not be editing much and can create a new one to override the one they need to edit but still should think about integrating context or redux.

JMStudiosJoe commented 6 years ago

context it is https://reactjs.org/docs/context.html

ctram commented 6 years ago

@JMStudiosJoe Hi folks, are you guys accepting contributions for this project?