i am making a portfolio webpage using reactJS; i use react router to navigate into different parts of the SPA,the data i use is from resumeData.json; but i am having trouble to pass data through other components. you can help me through my github page github.com/tonnyhideyori/portfolio
my previous portfolio is edwin.alcalgroup.com
and the github respo is github.com/tonnyhideyori/portifolio
Abinav Seelan
UI Engineer @Flipkart β’ https://abinavseelan.com π
So it really depends on how your components are laid out right?
Try laying out your application as a tree of components first, with a root component. Components nested within this root component are children of the root component, and components nested within the children of the root component as their children and so forth!
If the components in question are in a parent-child relation, wherein one component is nested within another, then the way you would send data from the parent to the child is through
propsIf the components are siblings nodes in the tree, ie on the same level, then a way of sharing data between them is by having the data stored in the siblings' parent, and then sending it down as props from the parent component to the it's children, ie the siblings.
While this is one way to do it, the bigger your application gets the more you would start needing a state management tool like redux. π