DEV Community

Cover image for Fun with React and Styled Components
Mike Haslam
Mike Haslam

Posted on • Updated on

Fun with React and Styled Components

I need to make a React component that enables users to create tags on their profile. It's for a React project of mine, still a work in progress.

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 My CodeSandbox of my refactor have a look let me know what you think or if you have any optimization suggestions.

Here is a link to my repository with a few other styled-components would be cool if others wanted to contribute I could add some more also.

Top comments (0)