Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Reusable React Component in Kumparan

Reusable React Component in Kumparan

How we build cross platform UI component for reuse with React

Avatar for Rizal Ibnu

Rizal Ibnu

March 27, 2019
Tweet

More Decks by Rizal Ibnu

Other Decks in Programming

Transcript

  1. Reusable React Component in Kumparan How we build cross platform

    UI component for reuse with React Rizal Ibnu Software Engineer @kumparan
  2. The use of existing assets in some form within the

    software product development process that touches every stage of development and every level of an organization
  3. Why do we use React ? • Reusable components •

    Cross-platform with React Native • Sensible data flow • It’s fun to code!
  4. UI Kit Set of standards and solutions for the user

    interface, enabling a modular approach like “LEGO® bricks” and can be applied to universal, that is built on modules. A UI kit generally contains an assortment of UI components (buttons, check boxes, progress bars, etc.) for the purpose of user interface design.
  5. > yarn add an-awesome-uikit > npm install an-awesome-uikit import React

    from “react” import Button from “an-awesome-uikit/Button” class Component extends React.Component { render() { return <Button color=”primary”>Click Me!</Button> } } Note: an-awesome-uikit is unreal package name, for example only
  6. INTERNAL PLATFORM A INTERNAL PLATFORM B MOBILE WEB DESKTOP WEB

    ANDROID APP IOS APP INTERNAL PLATFORM C
  7. When? • Develop from the beginning is maybe not the

    best idea • Find a moment when building it will save development time
  8. Basic practice Put all low-level components with their styles into

    a separate folder. It will make it easier to extract it later into its own separate package.
  9. UI Core Libraries @kumparan • React & React Native https://reactjs.org/

    • Styled Components https://www.styled-components.com/ • React Native Web https://github.com/necolas/react-native-web • Storybook https://storybook.js.org/ • Flow Type https://flow.org/
  10. • Discoverability problem of hundreds of components • Not all

    components are created equal • Lack of documentation created some confusion
  11. Reusability is not just a technical decision, but also a

    philosophical one that requires organizational commitment and has far-reaching implications.