React-native-router-flux: how pass data from component to title

Created on 23 Mar 2018  路  4Comments  路  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v4.6.1
  • react-native v0.52.2

Expected behaviour

how to make title like picture, with place and date dynamic from component . catch data from scene component to title router ??

title

thanks

Most helpful comment

~Not sure if renderTitle solves this matter, but it was mentioned by OP - even though he solved in another way... Is it possible to set the title dynamically, from inside the Scene's component? E.g. my component's title is based on a field of a prop it receives.~

Going to submit a PR with an example to illustrate this. Found how to do it:
renderTitle={({prop}) => 'List: ${prop.name}'}

All 4 comments

https://github.com/aksonov/react-native-router-flux/blob/master/docs/API.md

Scene

renderTitle | React.Component | 聽 | React component to render title for nav bar
-- | -- | -- | --

ok, solved.
I use Actions.scene({ params: valueHere })

~Not sure if renderTitle solves this matter, but it was mentioned by OP - even though he solved in another way... Is it possible to set the title dynamically, from inside the Scene's component? E.g. my component's title is based on a field of a prop it receives.~

Going to submit a PR with an example to illustrate this. Found how to do it:
renderTitle={({prop}) => 'List: ${prop.name}'}

@blackinitial How to access to params in the screen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wootwoot1234 picture wootwoot1234  路  3Comments

moaxaca picture moaxaca  路  3Comments

fgrs picture fgrs  路  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  路  3Comments

sreejithr picture sreejithr  路  3Comments