A simple reusable React JS dropdown written with TypeScript.
Demo: https://reusable-dropdown.netlify.app
NOTE: This component has been developed for a coding challenge and is not production ready.
Feel free to clone and modify this repository but keep in mind this is not production ready code.
- Install the project dependencies
npm i
- Start the project
npm start
- The
Dropdown
component is located inside the components directory
src\components\Dropdown\index.tsx
-
The styling is being managed by the
styled-components
lib and you can find it in a file calledstyledComponents.tsx
on each component folder -
Eslint and Prettier are configured in this project to ensure code quality
-
The
Dropdown
component is being instantiated at theApp
component as well as the loaded property values
It would be much better to upload the Dropdown
component as a npm module so It's easier to implement it in other React projects. But since this is a time limited coding challenge I decided to leave it inside the project structure.
I actually have a React component library which I uploaded to NPM 3 years ago:
And also I made a full video (in Portuguese) explaining how I did it 😉