简体   繁体   中英

React Standalone Library for NPM

I'm currently writing a few components I want to open source and I always struggle to find the right way to bundle my components and logic so it can be easily imported in any React project.

I want to use React hooks and my current way of using tsc for it (I prefer Typescript) is not really working because React complains that React Hooks need to be used inside a function component (which they are, it seems TSC kicks out some of the context).

Are there any good resources for that or even boilerplates? Thank you already for your answers. Cheers to everyone contributing! I owe you.

You can use create-react-library . It also supports typescript.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM