React uses initialValue to initialize the ref's current property on the first render. Later calls return the same ref object rather than resetting it from the argument.