Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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