SheCodeAfrica-Nairobi / SheCodeAfrica-Nairobi-Website

The new open source website for SheCodeNairobi website 🥳
18 stars 25 forks source link

Use Context API & get rid of the prop drilling of the events response. #45

Open EspiraMarvin opened 2 years ago

EspiraMarvin commented 2 years ago

After the events are fetched in pages/index.tsx, theres' drilling of props into other components: layout, eventspane and footer components. I intend to use context api to get rid of this prop drilling.

katungi commented 2 years ago

Hey @EspiraMarvin , that's a great idea, but won't it be overkill since we are only passing the data to one component?

EspiraMarvin commented 2 years ago

@katungi I don't believe its an overkill since the events are passed from index.tsx to Layout component to reach the Footer, that's 2 components already, then to add on, the EventsPane component also accepts events as a prop.

It's about 3 components receiving the prop, Just looking at some good practices for scalability in the future.