FormidableLabs / redux-little-router

A tiny router for Redux that lets the URL do the talking.
MIT License
1.04k stars 114 forks source link

Fragment forNoMatch is always rendered #208

Closed albertogasparin closed 7 years ago

albertogasparin commented 7 years ago

I was trying to make the new "404" capability work, but it looks like the fragment gets always rendered.

const routes = { '/': { title: 'Home' } };

<Provider store={store}>
    <div>
        <Fragment forRoute="/">
            <h1>Home</h1>
        </Fragment>
        <Fragment forNoMatch>
            <h1>404</h1>
        </Fragment>
    </div>
</Provider>

You can see a running example of the code I'm using here. It happes with both routerForExpress and routerForBrowser. Am I doing something wrong?

tptee commented 7 years ago

Hey @albertogasparin , thanks for the notebook, that's super helpful! I cloned it to give you a working example: https://runkit.com/tptee/5961d0845c279100165f9df6

Looks a little weird without more routes 😬 but hopefully this makes sense!