Yes in react you can make your own elements like if you want to make elements.
Like an example given below:
1) Make a file of index.js in that you have to write code like given in image:
import React from 'react';
import ReactDOM from 'react-dom';
import If from './If';
ReactDOM.render(
<>
<If />
</>
, document.getElementById("root")
);
2) Now Make a File with If.jsx and this code
import React from 'react';
const If = () =>{
return ( <>
<h1> Hello World </h1>
</>
);
}
export default If;
3) Now save it and run this code and you will see the output like this:
Hello World
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Yes in react you can make your own elements like if you want to make elements.
Like an example given below:
1) Make a file of index.js in that you have to write code like given in image:
2) Now Make a File with If.jsx and this code
3) Now save it and run this code and you will see the output like this:
Hello World