Author: S.Adamovich (2023)
Version: 1.0.3
Necessary: Node ver: ^16.14.0 && Yarn
See Demo: https://the-react-clone.netlify.app/
npm module: https://www.npmjs.com/package/laniakea-core-ts
Get Started (install)
$ yarn
$ yarn start
$ yarn build
What new [ver 1.0.3]
useState
useRef
useEffect (only one fn per component in ver 1.0.3)
const FragmentWithStateHook = () => {
const [st, setSt] = useState(1);
const changing = () => setSt((prev: number) => prev + 1);
return (
<>
<button onClick={changing}>{st.toString()}</button>
</>
);
};
/* more you can see in 'MultState.tsx' as example */
const [st, setSt] = useState("");
const [counter, setCounter] = useState(1);
return isLoading ? <Preloader /> : <Examples />;