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

useRef hook and renderWithReuse #1037

Closed
cquiroz opened this issue Feb 4, 2022 · 2 comments · Fixed by #1045
Closed

useRef hook and renderWithReuse #1037

cquiroz opened this issue Feb 4, 2022 · 2 comments · Fixed by #1045
Labels

Comments

@cquiroz
Copy link
Collaborator

cquiroz commented Feb 4, 2022

The combination of useRef and renderWithReuse tends not to work as it requires a Reusability for the Ref but it doesn't seem to be defined in general

It gets fairly more complicated with useRefToScalaComponent and siblings

Could the Reusability instances be provided? I guess they should be always reused, right?

@cquiroz
Copy link
Collaborator Author

cquiroz commented Mar 1, 2022

Thanks, I tested it with a local build
I wonder if it is possible for useRefToScala/JSComponent too

@cquiroz
Copy link
Collaborator Author

cquiroz commented Mar 2, 2022

I can make it work with this but i'm not sure if it is correct:

  implicit def refScalaComponentRef[F[_], P, S, B, CT[-p, +u] <: CtorType[p, u]]
    : Reusability[Ref.WithScalaComponentF[F, P, S, B, CT]] =
    byRef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants