Razzle: get warning when fresh install and start

Created on 31 May 2019  路  2Comments  路  Source: jaredpalmer/razzle

I new to razzle, when I install it and start it I get following warning in console? How i solve them?

Warning: Please use require("react-router-dom").Route instead of require("react-router-dom/Route"). Support for the latter will be removed in the next major release.

Warning: Please use require("react-router-dom").Switch instead of require("react-router-dom/Switch"). Support for the latter will be removed in the next major release.

Warning: Please use require("react-router-dom").BrowserRouter instead of require("react-router-dom/BrowserRouter"). Support for the latter will be removed in the next major release.

My Node is v10.15.1 and npm is 6.9.0

Most helpful comment

in template need change in client.js

 import BrowserRouter from 'react-router-dom/BrowserRouter';

to

 import {BrowserRouter}  from 'react-router-dom';

and in App.js

import Route from 'react-router-dom/Route';
import Switch from 'react-router-dom/Switch';

to

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

All 2 comments

in template need change in client.js

 import BrowserRouter from 'react-router-dom/BrowserRouter';

to

 import {BrowserRouter}  from 'react-router-dom';

and in App.js

import Route from 'react-router-dom/Route';
import Switch from 'react-router-dom/Switch';

to

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

thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gabimor picture gabimor  路  3Comments

knipferrc picture knipferrc  路  5Comments

dizzyn picture dizzyn  路  3Comments

corydeppen picture corydeppen  路  3Comments

GouthamKD picture GouthamKD  路  3Comments