hyperstack-org/hyperstack

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

Open

#420 aperta il 6 ott 2021

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (43 fork)batch import
bugcompatibilitygood first issue

Metriche repository

Star
 (531 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor