How to inject style theme into react apps based on subdomain - reactjs

I'm building a series of personalized react apps that communicate to my back-end api.
I'm iterating on my api and adding features, and I implement those on the front end of each new app i make, but my problem is that the old react apps don't include the new functionality or components.
Is there a way to separate the styling from the hooks and components of the react app such that any features i add would automatically be overlayed with the appropriate styling based on something like the subdomain of the app?

Related

Exclude some components while building reactjs app

I have ReactJS webapp ready for building.
Now I want to build this app but do not need some components at present but will need them in future. So, ho could I exclude the unrequired components while building the application?

How to combine react and react-native projects?

I have created a website with react.js, Material-UI, and node.js. Now I want to create a mobile app for that website with React-native. I have used redux,react-redux, and saga on the website. I am new to react-native.
I want to know, Is it possible to create a mobile app and website in a single project structure, If possible then how? Because I don't want to repeat the same state and API calling procedure two times.
React.js uses HTML to render pages and React native doesn't support HTML so you can't use direct HTML.
You can buy react native theme that suits your need and you can re-use services and api call logic from react code.
Theme: https://codecanyon.net/search/react%20native
You can't just use your whole code into the react native app.
First and foremost, you must adhere to the react native architecture before creating your UI with react native components.
https://reactnative.dev/docs/getting-started
The most of the assistance will be found here.
There is also the option of creating a new react-native project and using webview to show your entire website there.
https://github.com/react-native-webview/react-native-webview

Using react-native components for react web

How can we use share components between react-native and react web projects. I have read react native can be derived from react. How is it possible to use same js code between two projects (fully or partially) ?
Take a look at the react-native-web library. It's pretty good:
https://github.com/necolas/react-native-web
As long as you only use react native components, e.g. View instead of div, and Text instead of p etc, you'll be able to share view components between your app and website. Then you can pass down all the data from API calls etc as props from within the individual mobile app/website code.
In my projects I have a common folder that contains all these shared view components, and only put the platform specific code inside mobile or web-app. It works pretty well that way.

Integrating React application to Struts application

I have 2 applications. One is completely developed in React.js and the other is developed in Struts. Now I'm trying to integrate react application into struts. To achieve this i used Iframe tag and provided theReact app Url to Iframe. Are there any other options to embed react i to Struts.
Can i achieve some thing like replacing a div with react application out put as in react replacing a root div using React Dom

Using React.js minimally with Express.js

I am in the process of full-stack engineering a web application. As the front-end framework I want to use React. I've learned JSX and I'm ready to build components; however there are many other frameworks and complications going in with React.
I am using express.js for routing and passport.js for securing the routing process. However, looking at several tutorials and forums I keep seeing other routing handling methods such as React Router.
My question is as follows, may I use React.js as a variation of templating engine? In other words, I'll use EJS for dynamically serve HTML and use React's component based approach to "texturize" the served markup. Is this possible or do I have to use React Router or some React features such as React history etc.?

Resources