Skip to content

Commit

Permalink
Reduce bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca committed Oct 30, 2021
1 parent a3ae2c7 commit 4c5ef69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fragstore",
"version": "0.6.0-canary.1",
"version": "0.6.0-canary.2",
"description": "Tiny, easy and powerful React state management (less than 1kb)",
"license": "MIT",
"keywords": [
Expand Down Expand Up @@ -47,7 +47,7 @@
},
{
"path": "./dist/index.umd.js",
"maxSize": "1.1 kB"
"maxSize": "1 kB"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions package/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useEffect, useReducer} from 'react';
import {useEffect, useReducer, createElement} from 'react';

let MODE_GET = 1;
let MODE_USE = 2;
Expand Down Expand Up @@ -31,7 +31,7 @@ export default function createStore(defaultStore = {}, callback) {
(a, c, index) => index === last ? a[c](initValue) : a[c],
useStore,
) : useStore(initValue);
return <Comp {...props} store={store} />;
return createElement(Comp, {...props, store});
};
WithStore.displayName = `withStore(${componentName})`;
return WithStore;
Expand Down

0 comments on commit 4c5ef69

Please sign in to comment.