Design comparison
Solution retrospective
I am proud of finishing this project and learning so much when doing it.
What challenges did you encounter, and how did you overcome them?Many struggles later I finished this project. Learned so much and am happy with that.
What specific areas of your project would you like help with?types in typescript
Community feedback
- @NewpokiPosted 8 months ago
Hi Pietrel, could you point specific part in your app where you'd like some help with your typescript types ? Maybe I can help you
1@PiotrPlotastPosted 8 months ago@Newpoki Hello, I'm new to typescript in general and know only basic types like
string
etc. so it'd be helpful to know how more advanced types work like for instance this one:setSearchedWord: (word: string) => void;
Any good resources for react types would be great.0@NewpokiPosted 8 months ago@PiotrPlotast I see, no problem. I don't know which editor you are using, but for example in VSCode, you can see type definition of elements when hovering them. For example, I assume that
setSearchWord
is the setter of auseState
, you will see that React exposes a pre definetype
for this, that you can import. It will allow you to avoid re writing it, and also, they'll be 100% correct, which is not the case here, because setter can access current state values.Best advices for TS I can give you, is to check Matt Pocock twitter / youtube for begginer to advanced TS usage, always look at what your IDE is you about types definitions and also, when using external lib, try to use as much as possible the types they're exporting as I previously said
All my frontend mentor exercices are built in TS, you can give a look at my repos if you want more insight about how it could look like
Marked as helpful1@PiotrPlotastPosted 8 months ago@Newpoki thanks a lot bro, I will check provided resources
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord