Comments (6)
Where would you like to pass it the onChange
from? You can do it when you push to the screen with the search bar using this.props.toRoute({ passProps: { onChange: *whatever you want* } })
from gb-native-router.
My understanding was that passprops would pass the props to the new component, not the titleComponent?
I'll give it a shot tonight then.
Ps, I simply edited the flex amount of the titleComponent in your library to stretch it :)
On 19 Oct 2015, at 02:03, Mikael Carpenter [email protected] wrote:
Where would you like to pass it the onChange from? You can do it when you push to the screen with the search bar using this.props.toRoute({ passProps: { onChange: whatever you want } })
—
Reply to this email directly or view it on GitHub.
from gb-native-router.
How would you pass Props in an InitialRoute to the TitleComponent?
from gb-native-router.
Sorry @webwelten it's not documented well. It would use the same approach as this.props.setRightProps
or this.props.setRightProps
rather than doing it in a route.
from gb-native-router.
How does it work? I didn't understand it as well.
from gb-native-router.
Say I call the Main component
renderMain: function () {
var firstRoute = {
name: 'Welcome!',
component: Main,
titleComponent: Search,
};
return (
<Router
firstRoute={firstRoute} />
);
}
then on Main.js
var Main = React.createClass({
componentWillMount: function () {
this.props.setTitleProps({
onChange: this.onChange
});
},
render: function () {
....
}
});
from gb-native-router.
Related Issues (20)
- Hiding navigation bar per route? HOT 5
- Animation seems slow HOT 11
- Publish to NPM HOT 1
- Make changes to the Navigation Bar inside the Component HOT 1
- Using 'events'? HOT 7
- Problem with peerDependencies while installing HOT 17
- Merge and release HOT 1
- Implementing a blurred NavBar HOT 2
- Go back to previous view by pushing a button HOT 3
- Disable swipe back HOT 2
- Access this.props.toRoute from an extern sidemenu HOT 1
- Scene transition doesn't respect background color HOT 4
- Can't navigate to a route already in the route stack HOT 4
- Can't use redux HOT 1
- Trying to combine with react-native-drawer HOT 1
- Invaliant Violation when back to first Route HOT 3
- Proposal of new Fork/Reporisory/Name HOT 15
- Blank top/title bar HOT 1
- Blank top/title bar
- READ THIS - DEPRECATED/DEFUNCT REPOSITORY
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gb-native-router.