Open
Description
codesandbox: https://codesandbox.io/s/interesting-panna-urdtu6?file=/src/App.js
import { signal } from '@preact/signals-react'
const opacity = signal(1)
setTimeout(() => {
// Should be transparent in 3 seconds ...
// Works with opacity={opacity.value} but then it re-renders
// Doesn't work as opacity={opacity}
opacity.value = 0.5
}, 3000)
function Box() {
return (
<mesh>
<boxGeometry />
<meshBasicMaterial transparent color="orange" opacity={opacity} />
</mesh>
)
}
it's not a div, but it would be fantastic if it could work.
Metadata
Metadata
Assignees
Labels
No labels