2

i am use react-router v4. And have this tabs (material-ui) in App component:

                <Tabs
                className="tabs"
                value={this.state.currentTab}
                onChange={(newValue) => this.tabChange(newValue)}
            >
                <Tab
                    value="1"
                    label="Params"
                >
                    <div>
                        <Params paramsStart = {this.start} onSave = {this.onSave} info = { this.state.info }/>
                    </div>
                </Tab>
                <Tab
                    value="2"
                    label="Summary"
                >
                    <div>
                        <Summary goodCheck = { this.state.checkGood } onGoodSelect={this.goodSelect} />
                    </div>
                </Tab>
                <Tab
                    value="3"
                    label="Note"

                >
                    <Note results={ this.state.results} info = { this.state.info } currentId = { this.state.currentId }/>
                </Tab>
            </Tabs>

In router.js:

import React from 'react'
import { BrowserRouter, Route } from 'react-router-dom';
import App from '../App'

export const Routes = () => (
    <BrowserRouter>
        <Route name="App" path="/" component={App}/>
    </BrowserRouter>
)

I am want for every tab make own Route. But when i add in tab this:

containerElement={ <Link to={{
                    pathname: '/note'
                }}/> }

and turn on the link

http://my-site/note

i have 404 Not Found from nginx

user3045654
  • 1,634
  • 2
  • 12
  • 21
  • You need to define a `` that matches the `/note` path before creating a `` to that path. Also, unless you put a catch-all route server-side, or render your React server-side as well (aka universal/isomorphic React), you'll have to use `` instead of ``, or you'll have trouble if your users bookmark or manually navigate to any route other than your root index. – Thomas Hennes Oct 16 '17 at 14:11
  • Possible duplicate of [Material-UI's Tabs integration with react router 4?](https://stackoverflow.com/questions/41638688/material-uis-tabs-integration-with-react-router-4) – Christiaan Westerbeek May 10 '18 at 05:51

0 Answers0