Closed wereHamster closed 8 years ago
@alexmingoia I noticed just now but you removed the changes on line 50/51. Was that intentional?
This is the merge commit: https://github.com/alexmingoia/purescript-pux/commit/cc7acbd3b51340fcb609c55b05a69c6d8b1cfc83
The prototype of
React.createElements
is:The children array is not passed in the third argument, but instead passed as varargs.
The syntax of calling functions with varargs is easier in ES2015 with the spread operator:
React.createElement(comp, props, ...children)
. In ES5, we have to use.apply
.This avoids the React warning about missing keys. This warning is only generated if one of the children is an array (technically allowed, but each item therein must have a
key
prop).In short, this generates a warning:
while this does not: