Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const Effect = () => {
const ref = useRef();
useEffect(() => {
if (ref.current != null) {
ref.current.style.backgroundColor = 'yellow';
}
});
return (
<button type="button">
I should be yellow
</button>
);
};