react-router-native icon indicating copy to clipboard operation
react-router-native copied to clipboard

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

Open joonhocho opened this issue 8 years ago • 8 comments

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

joonhocho avatar Jun 23 '16 10:06 joonhocho

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.

jmurzy avatar Jun 24 '16 04:06 jmurzy

Excited for new changes in NavigationExperimental!

joonhocho avatar Jun 24 '16 07:06 joonhocho

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

🍺

jmurzy avatar Jun 24 '16 08:06 jmurzy

@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

cpsubrian avatar Jul 12 '16 03:07 cpsubrian

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

jmurzy avatar Jul 12 '16 05:07 jmurzy

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 avatar Jul 12 '16 05:07 cpsubrian

Thanks for taking a look.

cpsubrian avatar Jul 12 '16 05:07 cpsubrian

Is it possible to pass information in <Route/> 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..."/>

Eightyplus avatar Oct 25 '16 12:10 Eightyplus