Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inferno-router props.children is Empty #60

Closed
Khangeldy opened this issue Dec 31, 2017 · 3 comments
Closed

inferno-router props.children is Empty #60

Khangeldy opened this issue Dec 31, 2017 · 3 comments

Comments

@Khangeldy
Copy link

Khangeldy commented Dec 31, 2017

In development everything works correct. But when i deployed my app into github pages. I get error cause this.props.children is empty. See Open dev console output. What i am doing wrong?

Root.js

const routes = (
  <Router history={browserHistory}>
    <Route component={App}>
      <IndexRoute component={Home}/>
      <Route path="/about" component={About}/>
    </Route>
  </Router>
)

App.js

<div className="App-intro">
  { console.log(this.props, this.props.children)}
  { Inferno.cloneVNode(this.props.children, {diffMode: this.state.activateDiffMode}) }
</div>
@LukeSheard
Copy link

LukeSheard commented Dec 31, 2017

I think you might need to add the path="/" prop to your App Route component. What's the actual error that you're getting? and which version of Inferno do you have installed?

@Khangeldy
Copy link
Author

Error is a chilren property. It is empty. In above code cloneVnode first parameter get null type. I think this problem related to github SPA pages. I solved error by changing browserHistory to hashHistory. And error only reproduced in github pages.

"dependencies": {
    "gh-pages": "^1.1.0",
    "inferno": "^3.10.1",
    "inferno-component": "^3.10.1",
    "inferno-router": "^3.10.1",
    "inferno-scripts": "5.0.0"
  },

screenshot from 2018-01-01 14-34-26

@Havunen
Copy link
Member

Havunen commented Dec 9, 2023

Closing this old issue.

@Havunen Havunen closed this as completed Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants