gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

getSeed() returns 0 for multiple forms on React 16 #403

Open STRML opened 6 years ago

STRML commented 6 years ago

Version

Expected behaviour

Two forms on the same page should have different generated IDs.

Actual behaviour

These forms use the same ID due to https://github.com/gcanti/tcomb-form/blob/eb1c6cf3ba0d04b16adfff922c19dd0bad5c33de/src/components.js#L800-L814

Steps to reproduce

  1. Put two forms on a page with React 16.
  2. Notice their IDs are the same
  3. ???
  4. Profit
STRML commented 5 years ago

If two forms have the same ID this causes React to behave very strangely on updates.