Refactoring components in React with custom hooks | Dark Hacker News