Commit e16118d
Fix createElementKeyed_ to refer correct 'createElement' (#47)
I might just be very confused here, I didn't try using
`createElementKeyed` myself, and none of examples are using it, so
it's just an educated guess (TODO: add example).
There are following foreign imports in `React.Basic`:
```haskell
foreign import createElement_ :: forall props. Fn2 (ReactComponent { | props }) { | props } JSX
foreign import createElementKeyed_ :: forall props. Fn2 (ReactComponent { | props }) { key :: String | props } JSX
```
They are pretty much the same, except that one allows to set the `key`
property. Implementations are defined as follows:
```haskell
exports.createElement_ = function(el, attrs) {
return React.createElement.apply(
null,
[el, attrs].concat((attrs && attrs.children) || [])
);
};
exports.createElementKeyed_ = React.createElement;
```
The `React.createElement` seems like a typo, as it won't even match a
type. It should be `exports.createElement_` instead.1 parent 8c34fe8 commit e16118d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments