I installed the momentjs using "npm i react-moment --save"
My moments js is installed in node_modules/react-moment
Should I import
import moment from 'react-moment';
or
import moment from 'moment'; (this is given in example)
Although both are not working, I get the same error!
Should be able to import react correctly
Gives module not found error
Installed datepicker using npm
installed momentjs using npm
Still getting this error
Did you restarted your builder watch mode?
I had the same issue with the following dependencies:
"dependencies": {
"firebase": "^5.4.1",
"moment": "^2.22.2",
"react": "^16.4.2",
"react-datepicker": "^1.6.0",
"react-dom": "^16.4.2",
"react-loadable": "^5.5.0",
"react-moment": "^0.7.9",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.5"
},
After deleting the node_modules and a fresh npm install it seems to work
Moment.js was removed in #1527, starting v2.0.0, this package doesn't use Moment anymore.