You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable errors by adding // @ts-check to the first line in the file.
Testing changes
A few different options for testing changes —
At the bottom of a file, write a dummy component that uses the component that you’re converting to ensure that you can still pass all appropriate props.
Take a storybook example for a component, copy and paste it into the bottom of the .tsx file and validate whether or not it accepts the props as you’ve defined them.
The content you are editing has changed. Please copy your edits and refresh the page.
As we add Typescript support, want to call out a few helpful tips from the Carbon TypeScript guide that is largely relevant to our library as well.
Changing the extension via git
When changing the file extension — do not simply rename the file. Instead, change the extension via
git
.For example,
Do not add types to internal components or functions
.js
/** @type any */
// @ts-check
to the first line in the file.Testing changes
A few different options for testing changes —
.tsx
file and validate whether or not it accepts the props as you’ve defined them.Tasks
Resources
Carbon’s guide on adding component types
The text was updated successfully, but these errors were encountered: