Comments (7)
you have a couple of options. I usually prefer to delegate the current control to an outside state, in the parent of Stager
and check from there. you can use the functions in context like context.has('prev')
or context.has('next')
to determinate if you can show / hide the control buttons. the default implementation can show you how to do it (in https://github.com/pocesar/react-native-stager/blob/master/src/index.tsx#L445-L457) just change this.state
to context.state
the docs are lackluster regarding the API, but I'll complement it soon. eventually I'll add public getters from the state, because context.state
seems hacky
from react-native-stager.
from react-native-stager.
from react-native-stager.
How would you go about conditionally showing the next only on some stages?
There are some situations where the next button should be disabled until the user enters the correct information.
Example: next buttons should be disabled until the pin has 4 digits...
from react-native-stager.
Nvm. I just saw this.
<Button title="can continue" onPress={() => {
this.setState({
canContinue: true
}, instance.refresh)
}} />
from react-native-stager.
Next question is, in the above example the step progress bar does not stretch across the view. How do that?
from react-native-stager.
the
<View style={styles.progressPad} />
in https://github.com/pocesar/react-native-stager/blob/master/src/index.tsx#L436 is to force using 30% of the available screen width with an empty element. you can remove that and set the flex of the styles.progressFlex
with a flex: 1
to use all available space
from react-native-stager.
Related Issues (10)
- How to use StageProgress and StageButtons ? HOT 2
- Consider write the documentation for instance.refresh, instances.forceUpdate& context.notify HOT 1
- Screenshots or Demo Video HOT 1
- instance.refresh && state HOT 9
- Go to specific stage HOT 2
- Unable to resolve module HOT 7
- Override stager/stage styles HOT 4
- Conditional render of stage HOT 15
- StageButton onPress called twice then three times HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-stager.