Create a Tags UI Component in React and Styled Components
Try it here https://bef94.csb.app/
I need to make a React component that enables users to create tags on their profile.
So I went looking to see if anyone had already created such a component. I did find this component on CodePen by Fabio here is a link to his pen
I decided instead of Willy Nilly cutting and pasting into my project, I would instead refactor to use Functional Components managing state with Hooks and styling with Styled Components.
I have found that refactoring other people’s code really forces you to understand how the code actually works instead of just following along.
Here is a Code Sandbox of my refactor have a look let me know what you think or if you have any optimization suggestions.