jmurzy / react-router-native

A routing library for React Native that strives for sensible API parity with react-router 🤖
MIT License
638 stars 44 forks source link

What would be the best way to dynamically change content of overlay from scene? #26

Open joonhocho opened 8 years ago

joonhocho commented 8 years ago

Moved question to https://github.com/facebook/react-native/issues/8350

jmurzy commented 8 years ago

See my comment here. In terms of react-router-native, we should probably make this easier by passing the overlay ref in props to route components as soon as facebook/react-native@c57bac4767fe4301ff4515b073d26245c6905610 lands in a stable release.

joonhocho commented 8 years ago

Excited for new changes in NavigationExperimental!

jmurzy commented 8 years ago

Same here. I think we are only a couple weeks away from calling it just Navigation. ⌛️

🍺

cpsubrian commented 8 years ago

@jmurzy Hey, posting the gist I linked to from Discord so others can follow-along/help. This is my attempt (not a runnable example, but has all relevant redux code) at using redux to control the title of a overlayComponent. The issue is that the actions do not fire when routes change from pop/back/etc because the components have already rendered.

https://gist.github.com/cpsubrian/278ad43f79f2301c4aba1cb5401fca99

jmurzy commented 8 years ago

@cpsubrian Thanks for the gist. I'll try to reproduce this on my end, and get back to you in the next few days.

cpsubrian commented 8 years ago

Yeah no rush, in the meantime just adding the header in the component. Would be nice to get the animations driven by the interpolators back at some point though.

cpsubrian commented 8 years ago

Thanks for taking a look.

Eightyplus commented 7 years ago

Is it possible to pass information in to compoent and overlay? I have the two paths below and only need to add title of the header and the text inside of TextView.

<Route path="/help" component={TextView} overlayComponent={HomeHeader}/>
<Route path="/information" component={TextView} overlayComponent={HomeHeader} />

something like

<Route path="/help" component={TextView} overlayComponent={HomeHeader} title="Help" text="Help Text"/>
<Route path="/information" component={TextView} overlayComponent={HomeHeader} title="Information" text="bla bla..."/>