I coded my own Harry Potter sorting hat using React js, and I explained how to use React Hooks (useState and useEffect) to do it.