I don't know why but, everytime i need to restart the server to update the react page view even if it's a little change in layout, before i was used to only refresh the page without the necessity to restart my entire server, but it's very irritating, i tried to use the package hot-reloaded but it doesn't works, someone knows how to fix it?
Thanks
package.json
{
"name": "docapp",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"bootstrap": "^5.1.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"reactstrap": "^9.0.0",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter, Switch, Route, browserHistory } from 'react-router-dom';
import 'bootstrap/dist/css/bootstrap.min.css';
ReactDOM.render(
<BrowserRouter>
<Switch>
<Route path='/' exact={true} component={App} />
</Switch>
</BrowserRouter>,
document.getElementById('root')
);
reportWebVitals();
App.js
import logo from './logo.svg';
import React from 'react'
import './App.css';
import FormCadastro from './forms/FormCadastro'
class App extends React.Component {
render() {
return(
<div className="App">
<h1 style={{textAlign: 'center'}}>Formulario</h1>
<FormCadastro/>
</div>
);
}
}
export default App;