ctrlplusb / react-tree-walker

Walk a React (or Preact) element tree, executing a "visitor" function against each element.
MIT License
345 stars 34 forks source link

Add support for React.forwardRef #39

Closed bartlangelaan closed 6 years ago

bartlangelaan commented 6 years ago

I'm not that familiar with this module, but this seems to fix #38.

It uses the internal $$typeof property from React. I didn't test it with Preact, but I couldn't find anything about forwardRef in Preact so I think it doesn't exist yet.

codecov[bot] commented 6 years ago

Codecov Report

Merging #39 into master will increase coverage by 0.2%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #39     +/-   ##
=========================================
+ Coverage   95.87%   96.07%   +0.2%     
=========================================
  Files           1        1             
  Lines          97      102      +5     
  Branches       29       31      +2     
=========================================
+ Hits           93       98      +5     
  Misses          4        4
Impacted Files Coverage Δ
src/index.js 96.07% <100%> (+0.2%) :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 c04e8c1...0d9f69e. Read the comment docs.

ctrlplusb commented 6 years ago

Awesome! Thanks for taking this on. I will try review soon. 🤘

bartlangelaan commented 6 years ago

That would be awesome! This is blocking upgrading some of our websites to the latest version of React.

ctrlplusb commented 6 years ago

Nice work. 👍