🚨 Please create a private fork of this repository and make all PRs into your own repository
-
Try this exercise in 4 hours. 🕙
-
There are no right or wrong answers. Most likely you won't have time to finish all the tasks. We are looking for:
- Code quality ✅
- Structure, , ✅
- Component boundaries ✅
- Architectural decisions (e.g. why have you used this package?) ✅
-
This is a real world situation. You are allowed to use the internet!
There is a basic search component patients_search.tsx
. It allows a user to type a query and have the results return to the parent component.
It's a little janky, sometimes it doesn't search for the correct query. The component boundary is confusing also.
Add a test for this component. Feel free to use whichever testing library you think is best.
Now that we have a useful test for this component. Please refactor this component to remove the peculiar behaviour when searching for something. Bonus points for addressing the confusing component boundary.
Add a loading spinner (feel free to use anything) to provide the user with some visual feedback while it is waiting for a network request to complete.
Error handling is a little old fashioned. Currently the errors are handled in the components and just popped up via an alert
:
// patients_search.tsx
loadPatients(sq).then(ps => onResults(ps)).catch(err => alert(err))
We would like your to create a reusable "toast" component hook to show to the user when an error is encountered. There is a base component to use for styling in src/toast/toast.tsx
. We are not looking for you to use a library here, but rather implement this in React yourself.
- Create a private fork of this repository
- Create a new branch in your fork
- Commit on that branch
- When you are ready to submit, create a PR back to your fork
- Add the user @heartbeat-med (https://github.com/heartbeat-med)
- We will comment on the PR
- You can either submit more code or we can discuss in the next interview 🤘
- Any questions, reach out to us!
See LICENSE file.