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

Fix forcePage to control page properly #496

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tlatmdxo123
Copy link

For forcePage to function correctly as a controlled component, it is more appropriate to directly assign the forcePage prop instead of using state for managing it. Instead of setting forcePage in the initial state and then matching it in componentDidMount, utilizing the forcePage prop directly is recommended. If forcePage and the internal selected state are in sync, there should be no issues. However, if different values are assigned, the page will be activated using the selected state and then revert back to forcePage.

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

Successfully merging this pull request may close these issues.

None yet

1 participant