Open AleCaste opened 8 years ago
Can you update to the most recent version and test
Hello, I am trying to test this issue but after upgrading to rn-router v2.4.2 I am unable to run a really simple app using your router (I am using react-native v0.24.1).
'use strict';
const React = require('react-native');
const {
AppRegistry,
Component,
Text,
} = React;
const ReactRouter = require('rn-router');
const { Router, IndexRoute, Route, Transitions } = ReactRouter;
// ----------------------------------------------------------------------------
var Sample = React.createClass({
render: function() {
return (<Text>Hello</Text>);
}
});
var Routes = React.createClass({
render: function() {
return (
<Router {...this.props} defaultTransition={Transitions.Fade}>
<IndexRoute name="login" component={Sample} />
</Router>
);
}
});
class App extends Component {
constructor(props, context) {
super(props, context)
}
render() {
return (
<Routes platform="android" />
);
}
}
// ----------------------------------------------------------------------------
AppRegistry.registerComponent('react_native_app1', () => App);
When I run the above, I get Element-type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
So it seems I am stuck and now I cannot check the issue itself.
dede
Should be fixed now
Hello If I have two components
Home
andAbout
, and I have my routes defined the following way:Then on the
Home
component I can callthis.context.transitionTo('about1', { text:'Hello' });
and when doing so theAbout
component is mounted and within its constructor I callconsole.log(props)
and see the expected result:{ text: 'Hello' }
BUT... if I have routes defined with a depth higher than one...
and from the
Home
component I callthis.context.transitionTo('about1/about2/about3/about4', { text:'Hello' });
, theAbout
component is mounted but I don't get the expected props object when callingconsole.log(props)
from the constructor. I get something much more complex like:I should get
{ text: 'Hello' }
since that is the object I am giving to the transitionTo method, but is not happening. Is this a bug????Thanks! Alex