Newbie to expo-router & React-Native
I have two screens (a & b) for example, b being a modal which is presented over a.
How would I go about passing data from screen b (the modal) back to screen a?
app
-(tabs)
--account
---index.jsx (screen a)
-create-account
--index.jsx (screen b)
Usually when you are adding a screen to the stack you would use useLocalSearchParams();
however, I am popping a screen off the stack and the screen behind is already rendered.
From the React Navigation docs: Passing params to a previous screen
To achieve this, you can use the
navigate
method, which acts likegoBack
if the screen already exists. You can pass theparams
withnavigate
to pass the data back.