Created
April 15, 2018 15:45
-
-
Save sheryarshirazi/3659445524b309b93aee41c70711bad9 to your computer and use it in GitHub Desktop.
React JS 16, Fragments Example
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
import React from 'react'; | |
const Fragment = React.Fragment; | |
const person = (props) => { | |
return ( | |
<Fragment> | |
<p>Name: {props.name}.</p> | |
<p>Age: {props.age}</p> | |
</Fragment> | |
); | |
}; | |
const student = (props) => { | |
return ( | |
<> | |
<p>ID: {props.ID}.</p> | |
<p>Class: {props.class}</p> | |
</> | |
); | |
} | |
export { | |
person, | |
student | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment