In the previous tutorial, we learn how to create React native app from an already-existing website using webview.
When I created an app from a website, the major challenge I faced is to apply the CSS.
I wanted to style some of the UI components. But there is no direct way. After. doing a lot of research and trying different things, I finally cracked it.
The first question is, can we add CSS to the React-Native…
Yes, you can.
CSS styles to a WebView component in a React Native app can be applied using the
Let’s take the same example from our previous tutorial and will add the necessary code.
You can modify the code inside the
In the above example, we have changed the background color of the HTML body to red.
Instead of the body, you can also apply CSS using id or class object.
The code inside the
Make sure, you are cognizant of the code you are injecting as part of