How to render raw HTML content in React JS?
The return keyword inside the component's function is used to render the result. When a component renders a string value, it is included as text content in the parent element.
Example
import React, { Component } from 'react';
export default function App() {
return <h1 className="bg-secondary text-white text-center p-2">
Hello World
</h1>
}
Most Helpful This Week
How to build and use a custom react component from scratch?
Example of React JS with Material UI components
State and Props in React
How to pass properties from parent component to child component in React JS?
Example of React Bootstrap Datatable
How to pass an Argument to a Method used inside JSX expression?