Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
catmando opened this issue Oct 6, 2021 · 0 comments
Open

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

catmando opened this issue Oct 6, 2021 · 0 comments
Labels
bug Something isn't working compatibility compatibility with dependencies such as Rails, Opal, React, etc. NOT FUNCTIONAL COMPATIBILITY good first issue Good for newcomers

Comments

@catmando
Copy link
Contributor

catmando commented Oct 6, 2021

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
@catmando catmando added bug Something isn't working compatibility compatibility with dependencies such as Rails, Opal, React, etc. NOT FUNCTIONAL COMPATIBILITY good first issue Good for newcomers labels Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility compatibility with dependencies such as Rails, Opal, React, etc. NOT FUNCTIONAL COMPATIBILITY good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant