Closed mateuscdomingos closed 4 years ago
Hello - Thanks for opening this issue! You can try using and updating the activeStep
prop on the <ProgressSteps />
component.
activeStep allows you to start the component on a specific screen; if I change activeStep, the component will not be rendered because ProgressSteps manages the state. I did a fork to solve my problem, but I already send it as a pull request
Ah sorry, I think I misunderstood your original question. Didn't realize you were trying to change steps without using the button onPress.
I don't see a PR from you currently, but if you open one I'll review and see if it makes sense to merge it in!
I will also look into this and see if there's a good way it can be achieved currently.
I have a fix this issue (along with other issues) in a PR: https://github.com/colbymillerdev/react-native-progress-steps/pull/38
-> added componentWillUpdate
function to update state when activeStep
prop is updated
I've setState activeStep but it still dont rerender. Does it work?
@15110011 my PR has been merged but a new build has not been released to NPM / Yarn. You would need to pull the lib straight from git in your package,json to get the changes now! @colbymillerdev do you know when a build with the latest changes will be released?
@15110011 @curtismenmuir I'm gathering up a few more changes before pushing out the next release, but should have it out shortly
@curtismenmuir So how to pull the lib, could you give me the package name? I dont know how to pull from PR. Could you guide me? @colbymillerdev I really need active step now, so try to merge it for release as soon as you can. Thank you xD
@15110011 if you need to test changes locally for now then you could pull my PR:
"react-native-progress-steps": "git+https://github.com/curtismenmuir/react-native-progress-steps.git",
to your package.jsonTBH I would recommend waiting for @colbymillerdev to release the package as this should not be used in production. Colby has also added more changes since my PR, you will NOT have access to them.
If you do use my PR fork then you MUST update to pull from main package when released (I will be removing that fork once changes are available in main package). If you do not update to main package your builds will fail once I remove the fork.
To remove my PR run yarn remove react-native-progress-steps
and then install main package.
Sorry for the delay, but the newest release including these changes is now published on NPM.
https://github.com/colbymillerdev/react-native-progress-steps/releases/tag/v1.3.0
Change of control step by parent component. In my ProgressStep, there is a button that calls a route from my API, if it works, the Steps will need to call the next step.