Skip to content

Badge => TypeScript#184

Merged
mdespuits merged 7 commits intomasterfrom
badge-ts
May 28, 2020
Merged

Badge => TypeScript#184
mdespuits merged 7 commits intomasterfrom
badge-ts

Conversation

@mdespuits
Copy link
Copy Markdown
Contributor

EXAMPLE. DO NOT MERGE YET.

This is an example of converting a JS component to TS. Step I took

  1. Move index.js to Badge.tsx and create index.ts to re-export from the new Badge TS file.
  2. Run tests.
  3. Fix any immediate TS errors
  4. Commit
  5. Use React.FC and setup correct Badge props and resolve conflicts with PropTypes auto-typing.

I only made two small additions:

  • Deprecate round to prefer isRound. Open to reverting this.
  • Add typing to possible variants for useful autocomplete when using with consuming apps.

Fixes #182.

@mdespuits mdespuits self-assigned this May 24, 2020
Comment thread src/components/Badge/Badge.tsx Outdated
Comment thread src/components/Badge/story.js Outdated
Matthew Wells added 2 commits May 28, 2020 14:08
# Conflicts:
#	src/components/Badge/story.js
@mdespuits mdespuits merged commit 60f5e21 into master May 28, 2020
@mdespuits mdespuits deleted the badge-ts branch May 28, 2020 21:52
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.

Convert Badge to TypeScript

2 participants