-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
feat(#246): Add onChange and initialSlideIndex props to CH.Slideshow #248
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks a lot for the PRs @brianespinosa! I'll take a look later. One small thing: can you disable the thing that reorders the props for future PRs? It makes the review harder. |
Sorry... that's actually me and my OCD sorting alphabetically by habit. I'll make sure not to do that on other PRs. Is there a logical method you're using to sort these props and objects so I can follow that in the future? |
chaos |
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖 This PR introduced no changes to the javascript bundle 🙌 |
…trolled-slide # Conflicts: # packages/mdx/src/mdx-client/slideshow.tsx
Not needed in this scenario
Looks good, thank you! |
🚀 PR was released in |
Resolves #246
For the proposed use case, it is not enough to only initialize the Slideshow component with a starting slide. There also needed to be a way to expose the current slide so that someone could use that value to set in the current URL.
Adds an
initialSlideIndex
prop which allows initializing CH.Slideshow on a specific slideuseInitialState
hook which is used to make sure changing the initialSlideIndex after mount would not control the componentAdds an
onChange
function to the CH.Slideshow component which will get called every time the internal Slideshow state changes, and will return the internal state objectVersion
Published prerelease version:
v0.7.3-next.2
Changelog
🐛 Bug Fix
@code-hike/mdx
next
Authors: 2