There is a blank for the web application in which React + Redux should work with Spring Boot . Although the page should contain WebPage content. But there is nothing.
An error appears in the console with the import "babel-polyfill"; in reducers/index.js . Ie the import does not happen even though the library is loaded and the IDE link is working.
Just started learning react help please solve this problem. Thank.
This is the structure of the application:
This is index.html :
<div id="base-container"></div> <script type="text/babel" th:src="@{/index.js}" ></script> </body> This is reducers/index.js :
import 'babel-polyfill' import React from 'react'; import ReactDOM from 'react-dom'; import {Provider} from 'react-redux' import {createStore} from 'redux'; import allReducers from "./reducers/index"; import WebPage from './components/WebPage' const store = createStore(allReducers); ReactDOM.render( <Provider store={store}> <WebPage/> </Provider>, document.getElementById('base-container') ); This reducers/car.js :
export default function () { return [ { id: 1, model: 'Audi', speed: 400 }, { id: 2, model: 'BMW', speed: 300 } ] } This is reducers/index.js :
import {combineReducers} from 'redux'; import CarsReducers from './car'; const allReducers = combineReducers({ cars: CarsReducers }); export default allReducers; These are components/WebPage.js :
import React from 'react'; const WebPage = () => ( <div> <h3>Cars:</h3> <hr/> <h3>Details:</h3> </div> ); export default WebPage; My package.json :
{ "name": "react-spring", "version": "1.0.0", "description": "This is sample of freanding react and spring boot", "main": "index.js", "dependencies": { "babel-polyfill": "^6.26.0" }, "devDependencies": { "babel-core": "^6.26.0", "babel-loader": "^7.1.2", "babel-plugin-transform-regenerator": "^6.26.0", "babel-polyfill": "^6.26.0", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "react": "latest", "react-dom": "latest", "react-redux": "^5.0.6", "redux": "^3.7.2", "webpack": "^3.6.0", "webpack-dev-server": "^2.8.2" }, "scripts": { "test": "test" }, "presets": [ "latest" ], "repository": { "type": "git", "url": "react-spring-boot-sample" }, "keywords": [ "1" ], "author": "Pavel_Ravvich", "license": "UNLICENSED" } Spring security if something is disabled .antMatchers("/**").permitAll().anyRequest().authenticated()
I would be very grateful for any tips.
