Typescript React Library for a component

Whats the best way to create a Typescript React Library for a component I made and I want to share on npm? Also will it work with Nextjs SSR ?
2 Replies
Matvey
Matvey•7mo ago
You don't need anything special to make it work with next, just add "use client" at the top of the file. You can just copy the build command from some other popular small react library tsup is great for compiling libraries, and it works with jsx - https://github.com/egoist/tsup https://github.com/shuding/react-wrap-balancer is a great example of a library with one simple component
Citizen13𓂆 | TrackIt
Thank you so much for the great answer, I'll go check it out now and then let you know.
Want results from more Discord servers?
Add your server
More Posts