Skip to content

Instantly share code, notes, and snippets.

@forksofpower
Last active September 10, 2020 07:27
Show Gist options
  • Save forksofpower/d8afc97ded702d7062a2b75af86489e3 to your computer and use it in GitHub Desktop.
Save forksofpower/d8afc97ded702d7062a2b75af86489e3 to your computer and use it in GitHub Desktop.
React Facts

cool React Facts dude

  • All react components can be self closing. This includes basic html tags because React converts JSX elements to React Elements well before they are represented in the DOM.
const ImageWrapper = ({src}) => (
  <div
    class="wrapper"
    style={{ backgroundImage: `url('${src}')` }}
  />
)

is transpiled to:

React.createElement("div", {
  class: "wrapper",
  style: {
    backgroundImage: `url('${src}')`
  }
});

Links:

Super Co o l B r o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment