react-native-ui-stepper icon indicating copy to clipboard operation
react-native-ui-stepper copied to clipboard

Should react-native-ui-stepper move to Render Props?

Open hannigand opened this issue 6 years ago • 1 comments

Hey 👋

I wasn't quite sure where to put this but it's the only place I know where to reach out to Users.

I am thinking of rewriting the react-native-ui-stepper library so that it utilises the concepts of Render Props.

Please 👍 or 👎 to let me know if you're for or against this change.

What does this mean?

  • A newly written API that will deprecate previous versions.
  • (More importantly) You will have complete control of what components you render to display the stepper value. You will be responsible for providing styles.
  • There will be an out-of-the-box component that'll

How might the new API look?

import UIStepper from 'react-native-ui-stepper';

const App = () => (
  <UIStepper
    render={(value, onIncrement, onDecrement) => {
      <MyCustomStepper 
        value={value} 
        onIncrement={onIncrement}
        onDecrement={onDecrement}
       />
    }}
  />
)

// Your Custom Component
const MyCustomStepper = ({ value, onIncrement, onDecrement }) => (
  <Text>{value}</Text>
)

I'll leave this open as I would like to gather a general consensus before committing to a rewrite. It will automatically be closed off on 7th May 2018

Thanks.

hannigand avatar Apr 24 '18 14:04 hannigand