Skip to content

Commit 63596fa

Browse files
committed
somewhat more robust code
1 parent c05f971 commit 63596fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cra-hyperapp",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Hyperapp expansion pack for create-react-app",
55
"main": "src/index.js",
66
"bin": {

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const h = (type, props, ...children) =>
66
type,
77
typeof type === "function" && type.length === 1
88
? { ...props, children }
9-
: Object.keys(props).reduce(
9+
: Object.keys(props || {}).reduce(
1010
(otherProps, name) => ({
1111
...otherProps,
1212
[propRename(name)]: props[name]
@@ -53,7 +53,7 @@ export const connect = (mapStateToProps, mapDispatchToProps) => Component => (
5353
{
5454
...props,
5555
...mapStateToProps(secretInternals.store.getState(), props),
56-
...Object.keys(mapDispatchToProps).reduce(
56+
...Object.keys(mapDispatchToProps || {}).reduce(
5757
(otherActions, name) => ({
5858
...otherActions,
5959
[name]: data =>

0 commit comments

Comments
 (0)