-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relief for your TypeScript/eslint pain #2
Comments
Video 3.7 ("Reactβs key for items in a list") @ 3:51 if anybody sees this TypeScript error/Problem... "Property 'categoryName' does not exist on type 'object'." ...then you can resolve it by being more explicit in the signature of your function's "React.FC" <{ object }>. If this fails to compile:
Then try this instead:
BUT, good news: it seems newer versions of TypeScript or eslint might be more "forgiving" -- because, for me, no error shows up when I simply do this:
^ no ( or this may be a result of my devDependencies having a handful of |
Video 3.7 ("Sharing data between server and client") @ 2:34 FYI: if anybody encounters eslint issues with
...then switch to this syntax, to make those eslint "Problems" go away:
EDIT: However, doing this "workaround" makes it so the next video/step fails -- due to ' apostrophe and CR/LF in the data -- so I guess just do the original thing and ignore the warnings, and just forget that you ever saw this post... :sigh: |
Video 4.3 ("Fetching data after navigating to a new view") @ 2:42 While trying to display the clicked Contest, for anyone else whose TypeScript/eslint settings in VSC keeps giving them this terminal error...
...try this workaround I used: Inside this JSX line...
...replace the the JavaScript with this...
PS: yes it STILL fails to compile with this: PPS: And sadly it even fails with this: UPDATE: since in the next video this becomes annoying to do for every property, EASIER workaround is to just add |
Video 4.5 ("Server-side rendering of a custom path") @ 0:44 Tip/Solution to a frustrating problem re. the [Array] of "middleware" (in this case "string paths"), WARNING: While the video's code π€¦ββοΈ I discovered this because my code But changing it to So... perhaps as a Best Practices habit just always make sure you list the |
Video 5.4 ("Using an API endpoint to update data") @ 1:03 BUG "fix" if you are STUCK unable to run with the I was getting this blocking error: 𧱠My guess is that, due to the But LUCKILY, JavaScript lets you dynamically create a propertyName, so this lets you solve the problem: ...Instead of this: ...use this syntax: ^ The TRICK is the ending Hopefully this be helpful to anyone else blocked by this in their IDE/TypeScript/eslint! |
Also, not quite a code workaround, just a new URL location: Video 2.1 ("Why React?") @ 1:58 For those who got 404 when trying to access the "Complete Introduction to React" article: Luckily, it is archived @ https://lnkd.in/gCjJkxT8 ( https://web.archive.org/web/20230326023918/https://eng.galoy.io/react-intro/ ) |
Hi folks, excellent course overall, but a handful of times I encountered an error or "Problem" that was often TypeScript or eslint in VSC preventing my code from compiling. π€¦ββοΈ
So each time that I had to spend some time figuring out a workaround, I also posted it to my LinkedIn profile in case someone else might encounter the same or similar problem.
Many lessons learned along the way!
But now that I completed this course, and about to move on to new adventures, I thought hey why not put them all in one place, like... here in the
Issues
section on GitHub -- just to be helpful to any future participant who takes thisMongoDB-NodeJS-React
training.So here you go. HTH. π
The text was updated successfully, but these errors were encountered: