Skip to content

Instantly share code, notes, and snippets.

@sheryarshirazi
Created April 15, 2018 15:45
Show Gist options
  • Save sheryarshirazi/3659445524b309b93aee41c70711bad9 to your computer and use it in GitHub Desktop.
Save sheryarshirazi/3659445524b309b93aee41c70711bad9 to your computer and use it in GitHub Desktop.
React JS 16, Fragments Example
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