stephane-monnot / react-vertical-timeline

Vertical timeline for React.js
https://stephane-monnot.github.io/react-vertical-timeline/
MIT License
1.08k stars 158 forks source link

Change to use react-intersection-observer #67

Closed aricallen closed 4 years ago

aricallen commented 4 years ago

Hi, I started using your package. Its really awesome! While integrating with my app I noticed a few eslint issues and also saw that you could benefit from moving to react-intersection-observer. (https://github.com/stephane-monnot/react-vertical-timeline/issues/63)

Since you have saved me a bunch of time by providing this lovely package, I felt inspired to at least contribute back with some updates. Hope you find it helpful.

Fixes

Screen Shot 2020-05-25 at 4 58 21 PM

One thing to note is that depending on your comfort level with browser support, window.IntersectionObserver is still relatively new, so you may want to include a polyfill. Browser support is pretty solid at this point, but up to you. Let me know if you want me to include that in this PR or not.

Reference: https://github.com/thebuilder/react-intersection-observer#polyfill Browser support: https://caniuse.com/#feat=intersectionobserver

codecov-commenter commented 4 years ago

Codecov Report

Merging #67 into master will increase coverage by 12.50%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           master       #67       +/-   ##
============================================
+ Coverage   87.50%   100.00%   +12.50%     
============================================
  Files           2         2               
  Lines          16        10        -6     
  Branches        2         0        -2     
============================================
- Hits           14        10        -4     
+ Misses          2         0        -2     
Impacted Files Coverage Δ
src/VerticalTimelineElement.js 100.00% <100.00%> (+16.66%) :arrow_up:

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 5a68c7d...4de5e94. Read the comment docs.

stephane-monnot commented 4 years ago

Great !! I will check it soon and merge asap.