Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Allow the passing of props and bumped dependency versions #54

Open
wants to merge 81 commits into
base: master
Choose a base branch
from

Conversation

MikaelCarpenter
Copy link

Why

props

Originally had to pass data object and call it via this.props.data.myProp which seems unnecessary.

dependencies

If you had a recent version of react-native, you would get errors when running npm start

Unable to resolve module ./base64-vlq from /Users/mikaelcarpenter/gears-native/node_modules/react-native-router/node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js

{so on and so on}

What

props

Instead of passing data in your route, you can now pass passProps which takes in an object, and then creates a prop for each key: value pair in the object.

dependencies

Updated the version numbers in package.json dependencies.

This is also an update to a previous PR (#47) by wenkesj

Issue

Props #39
Dependencies #53

Example

_initialRoute = {
    name: 'Title'
    component: Home
    passProps: {
        prop1: 'hi'
        prop2: 'bye'
    }
}

App = React.createClass({
    render: function() {
        return (
            <Router firstRoute={_initialRoute} />
        )
    }
})

module.exports = App

Your Home component can now use this.props.prop1 and this.props.prop2

@MikaelCarpenter
Copy link
Author

@t4t5 :D

also for anyone wanting to make these changes manually to their project. After updating the dependencies: cd node_modules/react-native-router and npm update to apply the changes

@MikaelCarpenter MikaelCarpenter changed the title bumped dependency versions Allow the passing of props and bumped dependency versions Jul 31, 2015
@MikaelCarpenter
Copy link
Author

@jhabdas I haven't checked it out yet, but would you want to use it for the nav bar transitions rather than the opacity from tween-state?

davidLeonardi and others added 30 commits November 15, 2015 19:20
Changed resetToRoute to use a better navigator API

Fixed some jslint warnings
Allow recent versions of react-native too!
React-native dependency version bump
Added docs for resetToRoute
Converting to ES-6 style,
Implemented support for hiding the navbar per route
Implemented support for an event emitter when a route is focused (useful when you want to know when you navigate back to a route)
Fixed the missing closing tag intruduced in previous PR
Fixed requires to be destructuring assignments instead
Added support for hiding navbar per route
Style improvements
Styling improvements and fixing requires to be a destructuring assigmnent
Styling improvements
Adding docs for new features
Update NavBarContent.js
Update NavBarContainer.js
Re-adding changes that got lost
Add RC versions to RN dependencies
Switching to facebook emitter
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants