- All the questions in the challenge require you to have a good understanding of React and all of its familiar frameworks, JavasScript, TypesScript and API handling.
- If you are familiar with those, then this challenge should be very straight forward.
- All of your components, functions, objects and code must be typed with TypeScript.
- You must use React Hooks, no class components.
- When using TypeScript,
any
and@ts-ignore
should be avoided unless necessary and justified with comments. - Has no Lint Errors (Utilize Eslint).
- Your code is clean, formatted, imports are sorted.
- And finally has a beautiful UI.
- First, download this project as a .Zip or Fork it (if you fork it, make sure to set the project to private NOT PUBLIC), open up the project and run the development server:
yarn
yarn dev
-
Open http://localhost:3000 with your browser to see the result.
- Write your code/response in each file under the respected question.
Once you see the home page below, you are on your way!
There are 5 parts/questions to this challenge, all of which need to be completed to progress to the next step of the interview.
- Name
- Date (datetime)
- Active (boolean switch)
- Age (select from 1 to 70)
- Perform error handling on the form
- {id: string, name: string}[]
- {id: name}
- Perform error handling so that any object without that shape will throw an error.
- Call the function from a button press.
- You can use any library for this
Convert the providers in src/pages/_app.tsx
to use the providerComposer
provided in src/providerComposer.tsx
.
In src/pages/dataBase
create a trigger/function which will calculate the age on insert or modify given the birthday.
In this final question your task is to create a Combo Box but also known as an Auto Complete Input.
-
Your goal is to create a custom Combo Box that replicates Auto Complete component from MUI as best as possible.
We understand that creating such component would take a long time but to keep it short we are going to focus on implementing only a few functionalities within it.
- A Combo Box is a combination of TextField and a dropdown.
- Use the TextField component from MUI and allow the user to search through a list of 200 plus options within the dropdown.
- It needs to have a prop for
renderInput
and a prop foroptions
- The options can be an array containing of 200 objects.
- Example of the options array :
const top200Films = [
{ label: 'The Shawshank Redemption', year: 1994 },
{ label: 'The Godfather', year: 1972 },
{ label: 'The Godfather: Part II', year: 1974 },
...200 other options
]
-
If the query that the user typed is not in the list of options, inform the user in the dropdown that the entry does not exist.
-
You may refer to the Material UI Auto Complete or W3.org Combo Box Examples for reference of finished examples.
-
Finally, make sure it has a beautiful UI.
-
Add a prop for disabled options. Which will still show the option in the input if you search it but you can not select it.
-
Add Controlled States : The Component has two states that can be controlled.
- the "value" state with the
value
/onChange
props combination. This state represents the value selected by the user, for instance when pressing Enter. - the "input value" state with the
inputValue
/onInputChange
props combination. This state represents the value displayed in the textbox. - These two states are isolated, they should be controlled independently.
- the "value" state with the
DO NOT host your project on a public repository. DO NOT create a pull request to this project.
- Create a .zip but without the node_modules and upload it to a google drive and share your link to the drive at [email protected]
- If you host it on a private repository on GitHub then invite @pouyarezvani to access it.