hyperstack-org/hyperstack

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

Open

#420 geöffnet am 6. Okt. 2021

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (43 Forks)batch import
bugcompatibilitygood first issue

Repository-Metriken

Stars
 (531 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide