- Forums
- ionic
- How to create a simple IONIC React Component Class with React.FC
this is a simple boiler template you can use to build an ionic react component [4949], Last Updated: Mon Jun 24, 2024
edwin
Wed Sep 22, 2021
0 Comments
583 Visits
To build a component in Ionic React, you can simply use this template I have here.
import './ExploreContainer.css';
interface ContainerProps { }
const ExampleContainer: React.FC<ContainerProps> = () => {
return (
<div className="container">Hello World!</div>
);
};
export default ExampleContainer;
As you can see from this example, I have imported the css associated with this example, you don't have to include a css file but I am putting it here so you can see.
Next you will need a class and for ionic you will need the React.FC
This is very helpful if you need to build a new component from scratch.
I hope this helps you.