Since 9.0.0, when .current is set, this does not trigger a rerender. This is because the setRefElement function is only called when the ref set is called as a function. Certain libraries will set .current directly instead of calling the ref function, which React normally handles with a Ref, but the ref-like function in this hook introduced in 9.0.0 does not handle this case.
This PR fixes that by using a proxy to properly call setRefElement when .current is set.
Since 9.0.0, when
.current
is set, this does not trigger a rerender. This is because thesetRefElement
function is only called when the ref set is called as a function. Certain libraries will set.current
directly instead of calling the ref function, which React normally handles with a Ref, but the ref-like function in this hook introduced in 9.0.0 does not handle this case.This PR fixes that by using a proxy to properly call
setRefElement
when.current
is set.