React: Difference between revisions

Jump to navigation Jump to search
Line 1,676: Line 1,676:


== React fragments ==
== React fragments ==
<source lang="js">
function Cat({ name }) {
  return (
    <React.Fragment>
      <h1>The cat's name is {name}</h1>
      <p>He's good.</p>
    </React.Fragment>
  );
}
// equivalent to
function Cat({ name }) {
  return (
    <>
      <h1>The cat's name is {name}</h1>
      <p>He's good.</p>
    </>
  );
}
</source>


= React State Management =
= React State Management =