Frontend
This project was bootstrapped with Create React App.
1.Install
npm
npm i
or
npm i --legacy-peer-depsyarn
yarn2.Start
npm start
or
yarn start3.Build
npm run build or yarn buildBuilds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed.
User Guide
You can find detailed instructions on using Create React App and many tips in its documentation.
Merge commit
Status
Bugfix
Features
Refactor
Docs
Task name
-- status/task_name
Example: Feature/11-login-view
Functions
1. useCancelToken
a. Use cancelToken
const { newCancelToken } = useCancelToken();
const fetchData = async ()=>{
const result = await callApi(endpoint, params = {...params, cancelToken: newCancelToken()})
}
useEffect(()=>{
fetchData();
},[...dependencies, newCancelToken])b. Convert cancelToken in params
const fetchDataApi = async <T>(endpoint,params) => {
const { cancelToken, paramsNoneCancelToken } = convertCancelToken(params);
const paramsURL = formatParamsUtil(keyFilter, paramsNoneCancelToken);
try {
const result = await APIConfig(baseUrl).get(endpoint, { params: paramsURL, cancelToken});
return result
} catch (error) {
return error
}
};Last updated