This assignment entails creating a custom Material-UI Autocomplete component that meets specific requirements. Additionally, the assignee must create a Storybook story showcasing the component.
- Develop a custom Material-UI Autocomplete component (with TypeScript).
- Implement an
optionsprop to pass a function returning a Promise of an array of objects withvalueandlabelproperties. This function will serve as thequeryFnin theuseQueryhook provided by TanStack Query. - Ensure the component spreads the rest of the Material-UI Autocomplete properties.
- Forward the passed
refto the component. - Create a Storybook story showcasing the custom Autocomplete component.
All of the tools are installed and configured in the project. The assignee must only implement the custom Autocomplete component and create a Storybook story showcasing the component.
In order to run the project, you need to have Node.js and npm installed on your machine. If you don't have them installed, you can download and install them from the official website. We recommend using the LTS version.
- Clone the repository.
- Install the dependencies.
npm install- Create a new branch from the
mainbranch.
git checkout -b feat/github-username/autocomplete main- Copy the
.env.examplefile and rename it to.env.
cp .env.example .env- Run project.
npm run dev-
Implement the custom Autocomplete component in the
src/components/Autocomplete.tsxfile. -
Create
Autocomplete.stories.tsxfile in thesrc/componentsdirectory to showcase the component in Storybook.
To run Storybook, use the following command:
npm run storybook