12-30 1,024 views
react
making-react-reactive-pursuit-high-performing-easily-maintainable-react-apps
disable warning
// eslint-disable-next-line to ignore next line
/* eslint-disable */ to ignore all warnings in a file
Problem
Object doesn't support property or method 'startsWith' fixed
You'll need to implement .startsWith yourself. Here is the polyfill:
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}
React-Scripts
use jsx
replace react-scripts\conifg\paths.js src/index.js to src/index.jsx
use css-loader
开启后会对其他组件有影响,不建议这样干
How to Use CSS Modules with Create React App