ginpei / potoshop

http://potoshop.ginpei.info/
0 stars 0 forks source link

Replace require("history").createBrowserHistory #68

Open ginpei opened 5 years ago

ginpei commented 5 years ago

console.error node_modules/history/warnAboutDeprecatedCJSRequire.js:17

Warning: Please use require("history").createBrowserHistory instead of require("history/createBrowserHistory"). Support for the latter will be removed in the next major release.

mahmood-sayeed commented 3 years ago

If its react app and you are using react-router-dom --

The 2 lines of code that match the error are inside:

node_modules/react-router-dom/BrowserRouter.js node_modules/react-router-dom/HashRouter.js

modify 2 lines of code that match the error.

require("history/createBrowserHistory") change to require('history').createBrowserHistory();

same with the HashRouter.js file.

require("history/createHashHistory") change to require('history').createHashHistory();

Let me know if it helps :)

ginpei commented 3 years ago

Thank you for reminding me this project!