Hi have create a sample function and called inside the RenderDOM
But seeing in the brower end the output is not showing
Do anyone have any suggestion
JavaScript
x
17
17
1
import React from 'react';
2
import ReactDOM from 'react-dom';
3
import './index.css';
4
5
function wwhello(){
6
return <div>
7
<h1>Hello</h1>
8
<p>Summa</p>
9
</div>;
10
}
11
12
13
ReactDOM.render(
14
<wwhello/>,
15
document.getElementById('root')
16
);
17
What is wrong with this code
Advertisement
Answer
React component needs to be in capitalizing first letter:
You can see it in the log error:
JavaScript
1
3
1
Warning: The tag <wwhello> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.
2
at wwhello
3
So change it to:
JavaScript
1
16
16
1
import React from 'react';
2
import ReactDOM from 'react-dom';
3
4
function Wwhello(){
5
return <div>
6
<h1>Hello</h1>
7
<p>Summa</p>
8
</div>;
9
}
10
11
12
ReactDOM.render(
13
<Wwhello/>,
14
document.getElementById('root')
15
);
16