hyperstack-org/hyperstack

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

Open

#420 opened on 2021年10月6日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (531 stars) (43 forks)batch import
bugcompatibilitygood first issue

説明

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

コントリビューターガイド