We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import React, { useRef } from "react"; import { render } from "react-dom"; const Component = () => { const ref = useRef(); useEffect(() => { ref.current.style.color = "purple"; }, []); return <div ref={ref}>Hello!</div>; }; render(() => <Component />, document.getElementById("app"));
import { render } from "solid-js/web"; const Component = () => { let ref; useEffect(() => { ref.style.color = "purple"; }, []); return <div ref={ref}>Hello!</div>; }; render(() => <Component />, document.getElementById("app"));
In addition to removing useRef and replacing const with let, ideally we could remove the .current suffix after every ref.
useRef
const
let
.current
ref
A challenge is that refs shouldn't be passed into functions though; you'd need to wrap them in functions.
The text was updated successfully, but these errors were encountered:
done in react-use-ref-to-solid-let
Sorry, something went wrong.
No branches or pull requests
Input code
Expected Output
Additional context
In addition to removing
useRef
and replacingconst
withlet
, ideally we could remove the.current
suffix after everyref
.A challenge is that
ref
s shouldn't be passed into functions though; you'd need to wrap them in functions.The text was updated successfully, but these errors were encountered: