Content deleted Content added
Undid revision 1066243811 by 84.54.86.203 (talk) |
→Basic usage: The code previously used is legacy. The requested changes apply to how a basic react app/component is structured. Tags: nowiki added Visual edit |
||
Line 26:
==Basic usage==
The following is a rudimentary example of React usage in HTML with [[React (JavaScript library)#JSX|JSX]] and JavaScript.
<syntaxhighlight lang="
import React from 'react';
const Greeting = () =>{
return(
<div className="hello_world">
<h1> Hello, World! </h1>
</div>
)
}
export default Greeting;
</syntaxhighlight>
The <code>Greeter</code> function is a React component that displays the infamous introductory <nowiki>''</nowiki>Hello, world"
When displayed in a web browser the result will be:
<syntaxhighlight lang="html">
<div
<h1>Hello, World!</h1>
</div>
|