In this lesson we look at how to create a React Component package using TypeScript.
Creating a React Package is very similar to creating any other TypeScript Node package and we demonstrate that here.
Awesome course!
Yes! We want more :D
Thanks, this was interesting! Helpful stuff.
I don’t understand exactly what a peer dependency is. And I got this error where it says “Cannot find module 'react’” from fancy/lib when trying to use from the other project.
I got some error in the build. To solve the problem I added the lib configuration in the tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "es6", "dom"],
"jsx": "react",
"sourceMap": true,
"outDir": "lib",
"declaration": true
},
"include": [
"src"
]
}
The tsconfig is wrong. Please use proper tsconfig settings { "compilerOptions": { "sourceMap": true, "module": "commonjs", "lib": [ "dom", "es6" ], "target": "ES5", "jsx": "react", "declaration": true, "esModuleInterop": true, "outDir": "lib", "typeRoots": [ "node_modules/@types" ] }, "include": [ "src" ] }