typescript-library-starter
typescript-library-starter copied to clipboard
How to integrate REACT
How to integrate REACT; I want it will be great!
Hello my friend! Follow steps:
-
git clone https://github.com/alexjoverm/typescript-library-starter.git <YOUR_LIB_REACT>
-
cd <YOUR_LIB_REACT>
-
npm i react @types/react
- change file main to tsx
./src/lib.tsx
- write your component, as below:
import React from 'react'
export const Component = () => <div>foo bar</div>
-
rollup.config.ts
in line 13, change ts to tsx -
tsconfig.json
"compilerOptions": {
// ...
"jsx": "react",
}