I just spent 4 hours trying to do something the idiomatic React way, trying about 6 different implementations involving many lines of code changes.
Ultimately I gave up and wrote 2 lines of plain JS to fix the issue. Will it probably bite me in the ass later? Sure. Would the many lines of code changes that React wanted me to do ALSO have bitten me in the ass later? Also yes. At least this is a *legible* piece of inadvisable code.
Remember the DRY principle in web application development:
Don't React Yourself