Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ReactJS Style Guides

Adam Smith
September 17, 2016

ReactJS Style Guides

Developing a style guide for your project will bring long term gains but maintaining the guide over time can be a challenge. ReactJS solves this issue but using the same components in the style guide as in the application.

Adam Smith

September 17, 2016
Tweet

More Decks by Adam Smith

Other Decks in Technology

Transcript

  1. Why Style Guides Consistent branding for all platforms. Reduces confusion

    internally. Reduces confusion externally. Single source of truth.
  2. How does ReactJS help with the but..but..but… ReactJS brings consistency

    in the style guide and in the production application!
  3. What do you mean consistency? The style guide and your

    application use the same React components!
  4. Um.. what are components?! A snippet of code which stands

    alone yet is a part of a larger whole. ⛓
  5. What are props? Information passed into a component is called

    a prop — short for "property". Multiple bits of information are passed as attributes in JSX syntax.
  6. Ok, we know what props are
 …but what is state?

    An object containing data that determines how a component renders/behaves. 
 The state allows you to create components that are dynamic.
  7. Cool story bro… 
 but how is the state managed?

    `this.state` can exist at different levels of your application. Each level is managed by it’s own container component.
  8. What have we learned? React Applications are built upon a

    nested cascading set of components.
  9. State vs Stateless Certain components contain stateful information which is

    passed through to other components via props={data}
  10. Style Guides are reusable Components A style guide is a

    set of reusable components which can be altered via their props.