DenoDDeno
Powered by
PaulP
Denoβ€’8mo ago
Paul

React Library Best Practises

Hi, I'm trying to migrate our app-sdk and app-sdk-react from Node to Deno. The app-sdk went fine without issues and is able to be imported and uesd across Deno and Node/npm worlds without issue. But I'm having issues with React.

I don't have
react
react
in my dependancies as I use Denos built in support. My compiler options are;
   "compilerOptions": {
     "jsx": "react-jsx",
     "jsxImportSource": "react",
     "jsxImportSourceTypes": "@types/react"
   },
   "compilerOptions": {
     "jsx": "react-jsx",
     "jsxImportSource": "react",
     "jsxImportSourceTypes": "@types/react"
   },


But I'm unsure if this is the best practise. I don't want to add dependancies and requirements to my project if that limits the consumer - for example they may want to use Preact instead of React. Is there a guide on how to build React Libraries using Deno - and then an extension would be how to export it to npm (I assume using https://github.com/denoland/dnt)

I'm really keen to get this right as once the app-sdk and app-sdk-react are migrated to Deno, we intend to migrate the apps to Deno as well and we have 56 of them and growing (they're like client side applets) and they're all open source.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Error occurs when using React third-party component library
rottenroyRrottenroy / help
17mo ago
Deno vs Node for writing a React component library.
cameron808Ccameron808 / help
3y ago
Date library
linker_errorLlinker_error / help
3y ago
vite + react
dobbyshmurdahDdobbyshmurdah / help
2y ago