an assignment statement returns the value that was assigned And the ref function shouldn't return anything:
<div ref={(el) => {refs.current[i] = el}}>test</div>