There is a web sdk that i am trying to build and finding the solution for the same. The thing is it will be similar to any 3rd party library which will render to clients application in a id of a given dom. Kind of like how google maps api works.
My question is, is it possible to build such a library using react and if yes how should i go about it. Currently I am planning to write library in typescript and converting it to iife format using rollup and deploy it and write the HTML and CSS directly inside of DOM elements passed by client. Similar to how they are doing in book called Third-Party JavaScript Book by Anton Kovalyov and Ben Vinegar.
If it is possible to use react or any similar library for the task then it would be easy to create application in react and deploy it as a 3rd party to client. Because html and css will be seperate and react compiler will take care of building the library.
I didn't clearly get your question but if you are looking to create 3rd party packages using react, yes it is possible and you can easily import those anywhere just like other packages. There is not much of a difference here. You can go through this link how to create and publish:-
https://www.geeksforgeeks.org/how-to-publish-a-reactjs-component-to-npm/