Convert class-based to functional components
Convert React class components to functional equivalents with hooks, replacing lifecycle methods with useEffect and state with useState.
Preview
Copy prompt
Convert the following React class components to equivalent functional components using hooks: [Paste code]. Replace every lifecycle method with the appropriate useEffect or other hook equivalent, convert all this.state usages to useState, and extract any complex stateful logic into named custom hooks. Verify that all existing behaviour is preserved including side effects, error boundaries, and ref forwarding.
More
Refactoring
Prompts
