Colorful pattern
Colorful pattern

React components bake HTML semantics into their implementation. Take this Title component example:

While this isn’t a particularly interesting or robust component, it will help illustrate a useful concept. This component creates an HTML h1 element, applies a className prop set to "title" to style it, and then allows the consumer of the component to pass along whatever content they’d like to render using the children prop. In this case, the semantics is the heading level 1 expressed as an h1 element.

The component can then be used like so:

We can expect the Demo to yield something to the effect…

About

Eric Masiello

Software Engineer & UI Architect at Vistaprint

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store