created a React-nextjs-redux framework with custom-server.
- Node Setup
- define different development environment with urls
- customize server, map the api service, no CORS
- integrated nextjs with antd, use next/css to make antd work
- axiosServer make api calls to server, axiosClient is client inner request
- Config
- Unhandled Rejection (TypeError): Cannot read property 'call' of undefined when clicking Link vercel/next.js#5636 vercel/next-plugins#282
- Layout
- use styled.component to define different components
- Antd Modal is tricky, hide footer button and customize own foot is better.
- Antd Input onChange event, directly pass e.target.value instead of e, otherwise could not get target.value.
- switch statement in jsx
- video transition animation added
- Redux
- use _app.js under pages folder, set the reduxStore
- define actions and reducers in store.js
- connect mapStateToProps and mapDispatchToProps with Components
- workflow is action -> reducers -> state updated -> view
- Hook
- See About.js
- WebSocket
- set up a new socket to get data
- while route changes, remember to close socket to prevent memory leak
- Test API with SpringBoot
- use localhost:8080 to test with SpringBoot Restful API