We are happy to announce that we are in the middle of migrating our repository from Javascript to Typescript. While starting migrating components on your own, please pay attention to the following things:
- Please convert all the sub-components which the component is built from it in the same PR. You can ignore independent vibe components and migrate them to a different PR.
- There is no need to convert the component stories in the stage (MDX file and js files which are related), if there are any.
- If you want to add any general types or interfaces relevant to more than one component during the conversion, please add them to
src/types
. - If your component is an extension of another component, you can extend its props interface directly.
- Your component should be extending
React.FC
type - If your component exposes static enums on the component, those should be added to the interface and be assigned to the component itself.
const Tip: React.FC<TipProps> & { types?: typeof TipTypes };
- Object.assign(Tip, {
- types: TipTypes,
-});
+ export default withStaticProps(Tip, {
+ types: TipTypes,
+ });
- Please set the default props of the component to be part of the component signature and delete the component
propsTypes
anddefaultProps
. - If one of the props e.g.
children
should be either string, either react node(s), consider usingElementContent
type.