facebook / fbjs

A collection of utility libraries used by other Meta JS projects.
MIT License
1.95k stars 313 forks source link

Fix invariant function to throw error only if __DEV__ is true #348

Closed alihussain5 closed 4 years ago

alihussain5 commented 5 years ago

Related issue: https://github.com/facebook/fbjs/issues/347

A change was made in https://github.com/facebook/fbjs/pull/240/files that incorrectly flipped the logic to only throw an error if __DEV__ === false. This would change it back to only throw the error if __DEV__ === true as was the behaviour previously.

zpao commented 4 years ago

Oops. Thanks!