Last active
November 1, 2018 09:03
-
-
Save mrzarkovic/19d59ccbd2dfcb49db9985983afa012f to your computer and use it in GitHub Desktop.
New functional component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TitleComponent (props) { | |
return React.createElement( | |
'h1', | |
{className: 'main-title'}, | |
props.title | |
); | |
// Ili JSX | |
return <h1 className="main-title">{props.title}</h1>; | |
} | |
// Komponentu koristimo kao: | |
<TitleComponent title="Prosledjeni Naslov" /> | |
// Ispis u HTML-u: | |
<h1 class="main-title">Prosledjeni Naslov</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment