The child route "/ test" of react-router4, "/" cannot be rendered and does not match the route. Please take a look at it.

paste related codes:

i.app.jsx

render(){
    return (
     <HashRouter history={hashHistory}>
                <Switch>
                <Route path="/" exact component={Home}></Route>
                <Route path="/info" exact component={Info}></Route>
                </Switch>
    </HashRouter>
    )
}

2.home.jsx

import Test from "@/test.jsx";

handleClick = () => {
    this.props.history.push(`/test`);
};
render(){
    return (
        <button onClick={this.handleClick.bind(this)}></button >
        <Route path=`/test` component={Test} />
    )
}

3.test.jsx

render(){
    return (
        <div></div>
    )
}

export default withRouter(Test);

problem description: when I open http://localhost:3000/-sharp/, there is no problem. When I click the button to test the sub-route, the route is http://localhost:3000/-sharp/test, but it is not rendered and does not match. What is going on? all the methods on the Internet have tried, withRouter history and so on. It can"t be solved.
but info nesting routes are relevant. Can"t there be child routes in"/"?

Mar.12,2021

  

Hello, I also encountered this problem of yours. Have you solved it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea2cd4-479df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea2cd4-479df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?