Skip to content

REACT Best Practices Styling your components.

Patrick Alvin Luwum edited this page Jun 20, 2018 · 1 revision

Use styled-components to style your components

The basic idea of styled-components is to enforce best practices by removing the mapping between styles and components. This way, you can collocate your components with their corresponding styles , resulting in localized class names that do not pollute the global css namespace. When using styled-components, do not forget to plugin to support syntax highlighting in strings or maybe create a new one.

Example:

image