Updating the code to use React Hooks