hyperstack-org/hyperstack

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

Open

#420 ouverte le 6 oct. 2021

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)JavaScript (43 forks)batch import
bugcompatibilitygood first issue

Métriques du dépôt

Stars
 (531 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur