Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hannigand opened this issue Apr 24, 2018 · 1 comment
Open

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

hannigand opened this issue Apr 24, 2018 · 1 comment

Comments

@hannigand
Copy link
Owner

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.

@marcpicaud
Copy link

Hi @hannigand ,

I know I'm a bit late but this would be a great update for my use case. Right now, out of the box I'm facing and issue when displayValue is true. The stepper value overflows the container and I'm looking for a way to provide my own. (You can reproduce the issue with a floating point number btw)

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants