hyperstack icon indicating copy to clipboard operation
hyperstack copied to clipboard

Can't access components that are memoized symbols in React 17

Open catmando opened this issue 4 years ago • 0 comments

they changed something

you can patch it like this:

# patch to detect new style React memoized symbols
module Hyperstack
  module Internal
    module Component
      class ReactWrapper
        def self.stateless?(ncc)
          `typeof #{ncc} === 'symbol' || typeof #{ncc}.$$typeof === 'symbol' || (typeof #{ncc} === 'function' && !(#{ncc}.prototype && #{ncc}.prototype.isReactComponent))`
        end
      end
    end
  end
end

catmando avatar Oct 06 '21 17:10 catmando