- 
  Notifications
 You must be signed in to change notification settings 
- Fork 156
Export context for hooks support #76
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
Conversation
Codecov Report
Merging #76 into master will not change coverage.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #76 +/- ## ======================================= Coverage 91.27% 91.27% ======================================= Files 26 26 Lines 298 298 Branches 47 47 ======================================= Hits 272 272 Misses 22 22 Partials 4 4
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update bca9efe...2a702f6. Read the comment docs.
Also added a useController hook which exposes the parallaxController using React hooks.
Usage example:
import React, { useLayoutEffect } from 'react'; import { useController } from 'react-scroll-parallax'; const App = () => { const { parallaxController } = useController(); useLayoutEffect(() => { const handler = () => parallaxController.update(); window.addEventListener('load', handler); return () => window.removeEventListener('load', handler); }, [parallaxController]); return ( <div> {'...'} </div> ); };
@jscottsmith any thoughts on this?
Love it.
Can you update the README documenting this export. Your usage example would be good to add there too.
https://github.com/jscottsmith/react-scroll-parallax#parallax-controller-context
Updated the README, check it if everything is fine.
@jscottsmith ping ✋
Looks good, I’ll get it merged and publish a new release tonight.
Thanks for the contribution!
@zalishchuk published 2.2.0
Export
ParallaxContextforuseContexthook support.