Skip to content
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

Added the TypeScript support. #100

Closed
wants to merge 19 commits into from
Closed

Conversation

Willaiem
Copy link

Hi Kent!

I managed to convert this workshop from JavaScript to TypeScript.
I tested this myself and it's working as intended. 😊

I'm aware that in different workshops, the TypeScript version exists within the "next" branch, but because it doesn't exist, I wanted to let you know in some way that I wanted to apply my changes.

My additional notes:

  • globe/index.tsx - I decided to add the @ts-nocheck because I couldn't manage to resolve the typings issues. I think that this isn't as important to be typed as other parts of the workshop (but I can be wrong).
  • In exercises 5 and 6, precisely in the Cell component, I had an issue with accessing the cell number within the state.grid.
    const cell = state.grid[row][column] - this throws error in TypeScript since it could be undefined.
    I managed to fix this by creating an array and trying to access it.
    const cell = Array.from(state.grid[row] ?? [])[column] ?? 0
    But for me, it looks like an excessive workaround and I presume that there's a better solution than this.

@kentcdodds
Copy link
Member

This is awesome to have! I'll try to give this a look soon. I just got a new job and may not have time soon/ever 😅 but hopefully what you've done here will be useful to others!

@Willaiem Willaiem closed this Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants