Giter Site home page Giter Site logo

Comments (5)

elboman avatar elboman commented on April 20, 2024 1

Oh, I think I understand now.

By doing component: (props: any) => (<FirstPage {...props}></FirstPage>) you are actually creating an inline stateless component that renders the FirstPage one:

() => <something /> // <- this is a stateless component

The router injects the props to the component you declare in the state definition, that's the stateless component and not FirstPage.

To fix this you should declare the state like this:

component: FirstPage,

This way you avoid creating the wrapper component.

from react.

wilsonsergio2500 avatar wilsonsergio2500 commented on April 20, 2024

fyi, I am actually returning a component for the top is a <Top/>
component and Page one <FirstPage/>

from react.

elboman avatar elboman commented on April 20, 2024

From your code it looks like the page1 state is a child of the top state, make sure there's a UIView that can render the nested one, otherwise it won't render anything.

I created a small webpackbin (https://www.webpackbin.com/bins/-Kktv-C_NIb0Ptsl_wSO) and everything works normally. Do you think you can reproduce the error/problem so I can take a better look? I don't have enough info right now.

from react.

wilsonsergio2500 avatar wilsonsergio2500 commented on April 20, 2024

Thank you very much Marco..
All I needed it seems was..
component: (props: any) => (<FirstPage {...props}></FirstPage>),

from react.

wilsonsergio2500 avatar wilsonsergio2500 commented on April 20, 2024

ohhh awesome, I get it now. Thank you 👍

from react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.