Skip to content

[v4] MatchProvider.render() fails to return valid react element #3837

@kennetpostigo

Description

@kennetpostigo

Taking v4.0.0-2 for a spin after checking out the website. But I keep running into this error:
screen shot 2016-09-14 at 2 11 55 am

I thought that perhaps one of my components were what was causing the issue but I went through all of them and could not find any reason in my components but still same error. So then I removed <Navbar /> component and all <Match /> components except for the first one that uses the pattern '/' and it worked. But As soon as I add one more to the mix it fails. So I thought okay what If I add another that renders the same HomeContainer component. Again it still failed to render.

Heres the code that fails:

import React from 'react';
import Router from 'react-router/BrowserRouter'
import Match from 'react-router/Match'
import Miss from 'react-router/Miss'
// other components...

render(
  (
    <Provider store={store}>
      <Router>
        <Navbar isAuthenticated={true}/>

        <Match exactly pattern='/' component={HomeContainer}/>
        <Match pattern='/:username' component={ProfileContainer} />
        <Match pattern='/:username/:repo' component={RepoContainer} />
        <Match pattern='studio' component={StudioContainer} />
        <Miss component={NotFound} />
      </Router>
    </Provider>
  ), document.getElementById('app')
);

This code below works:

import React from 'react';
import Router from 'react-router/BrowserRouter'
import Match from 'react-router/Match'
import Miss from 'react-router/Miss'
// other components...

render(
  (
    <Provider store={store}>
      <Router>
        <Match exactly pattern='/' component={HomeContainer}/>
      </Router>
    </Provider>
  ), document.getElementById('app')
);

This code also fails:

import React from 'react';
import Router from 'react-router/BrowserRouter'
import Match from 'react-router/Match'
import Miss from 'react-router/Miss'
// other components...

render(
  (
    <Provider store={store}>
      <Router>
        <Match exactly pattern='/' component={HomeContainer}/>
        <Match pattern='/lol' component={HomeContainer} />
      </Router>
    </Provider>
  ), document.getElementById('app')
);

I've tried to follow along with the website but can't seem to find a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions