Skip to content

Instantly share code, notes, and snippets.

@iscott
Last active April 5, 2021 16:01
Show Gist options
  • Save iscott/715470192faffe1f2c387d6b8dca631a to your computer and use it in GitHub Desktop.
Save iscott/715470192faffe1f2c387d6b8dca631a to your computer and use it in GitHub Desktop.
4 Different Ways To Write An Arrow Function With JSX

4 different ways to write an arrow function with JSX

const SettingsPage = (props) => {
    return (
        <>
            <h1>SettingsPage</h1>
            <Link to="/">Home</Link>
        </>
    );
};
const SettingsPage = props => {
    return (
        <>
            <h1>SettingsPage</h1>
            <Link to="/">Home</Link>
        </>
    );
};
const SettingsPage = props => (
    <>
        <h1>SettingsPage</h1>
        <Link to="/">Home</Link>
    </>
);
const SettingsPage = props => <><h1>SettingsPage</h1><Link to="/">Home</Link></>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment