hyperstack-org/hyperstack

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

Open

#420 创建于 2021年10月6日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (531 star) (43 fork)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

贡献者指南