Documentation
Building your App
Remove Recoil

Remove Recoil

Recoil is the default global state management solution thats included with each template. If you'd like to remove it and use a different global state management solution this is what needs to be done to remove recoil.

Uninstall

npm uninstall recoil

Remove from src/App.tsx

Remove the following highlighted lines from src/App.tsx.

src/App.tsx
/// ...
 
import { useRecoilValue, useSetRecoilState } from "recoil";
import { T_CountStateData, T_SetCountStateData, CountStateData } from "@store/CountAtom";
 
/// ...
 
	const getCountState: T_CountStateData = useRecoilValue(CountStateData);
	const setCountState: T_SetCountStateData = useSetRecoilState(CountStateData);
 
/// ...
 
				<Route
					path="Global"
					element={
						<div className="route-block">
							<button
								onClick={() => {
									const newState: T_CountStateData = {
										value: getCountState.value + 1,
									};
 
									setCountState(newState);
								}}
							>
								increment
							</button>
 
							<p>Count: {getCountState.value}</p>
						</div>
					}
				/>
 
/// ...

Delete atoms in store

Then delete the file src/store/CountAtom.ts.