Skip to content

Instantly share code, notes, and snippets.

@mimnets
Created November 4, 2020 17:36
Show Gist options
  • Save mimnets/e78abb7670942b4a6b71cb1e192d098e to your computer and use it in GitHub Desktop.
Save mimnets/e78abb7670942b4a6b71cb1e192d098e to your computer and use it in GitHub Desktop.
import React from 'react';
// Correct! This is a component and should be capitalized:
function Hello(props) {
// Correct! This use of <div> is legitimate because div is a valid HTML tag:
return <div>Hello {props.toWhat}</div>;
}
function HelloWorld() {
// Correct! React knows <Hello /> is a component because it's capitalized.
return <Hello toWhat="World" />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment