Closed jchavarri closed 2 years ago
Perhaps if we use any "" Js.undefined
, React will ignore it?
The issue is with the prop name, not the value. I just tried {undefined: undefined}
and it works 🤣
https://codesandbox.io/s/spring-framework-enqjl?file=/src/App.js
I don't get any warning with {'': undefined}
either:
https://codesandbox.io/s/compassionate-glade-iep03?file=/src/App.js
Ah, you're right. 😕
When using a prop with
maybe
and passingNone
(e.g.maybe className None
), React.js will emit a warning:This happens in ml syntax:
https://github.com/ml-in-barcelona/jsoo-react/blob/d3924adb125a8a7fadb8c2535486127c9b05c1fa/test/test_ml.ml#L704
And Reason syntax:
https://github.com/ml-in-barcelona/jsoo-react/blob/d3924adb125a8a7fadb8c2535486127c9b05c1fa/test/test_reason.re#L1156
I tried using any other string like
_
or_unused
and in those cases React does not complain 🤔 Another alternative would be to conditionally push to the array.