Introduction to JSX Language in React
The JSX language is regular JavaScript, but with some additions that allow you to write tags directly in the code, without quotes.
Tags can be returned via return
:
function App() {
return <div>
text
</div>;
}
Tags can have attributes:
function App() {
return <div class="eee">
text
</div>;
}
Tags can be written into variables or constants:
function App() {
const elem = <div>text</div>;
return elem;
}
In your main component you have the following function:
function App() {
return <div>
text
</div>;
}
Change the text inside the div. Look at the changes that occur in the browser.
Add a few paragraphs to the div.
Add classes to your paragraphs.