E
E
Egor Zholnin2019-04-17 13:24:14
JavaScript
Egor Zholnin, 2019-04-17 13:24:14

Why are routes not added?

For some reason the route is not being added to the app's
component.jsx

import { Route, Switch } from 'react-router-dom';

export default props => (
    <div className="App main-content">
            <Switch>
              {props.admin.routes.length
                ? props.admin.routes.map((route, i) => (
                    <Route
                      exact
                      key={i}
                      path={route.path}
                      component={route.component}
                    />
                  );
                )
                : null}
            </Switch>
    </div>
  );

props.admin.routes
5cb6fe6fbfdec406276550.png
is fine here
react devTools is
5cb6fe79a1aa5107589574.png
empty here
props have data, but for some reason they are not rendered. With what it can be connected?
There is a BrowserRouter at the root of the application, everything is fine with that

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question