@bloc-js/react-bloc
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -7,3 +7,3 @@ import * as React from "react"; | ||
var registry = React.useContext(BlocRootContext); | ||
var bloc = React.useState(function () { return fn(registry); })[0]; | ||
var bloc = React.useMemo(function () { return fn(registry); }, [registry]); | ||
return bloc; | ||
@@ -20,3 +20,3 @@ } | ||
}; | ||
}, []); | ||
}, [bloc]); | ||
return state; | ||
@@ -23,0 +23,0 @@ } |
@@ -7,3 +7,3 @@ import * as React from "react"; | ||
const registry = React.useContext(BlocRootContext); | ||
const [bloc] = React.useState(() => fn(registry)); | ||
const bloc = React.useMemo(() => fn(registry), [registry]); | ||
return bloc; | ||
@@ -20,3 +20,3 @@ } | ||
}; | ||
}, []); | ||
}, [bloc]); | ||
return state; | ||
@@ -23,0 +23,0 @@ } |
@@ -29,3 +29,3 @@ "use strict"; | ||
var registry = React.useContext(bloc_root_1.BlocRootContext); | ||
var bloc = React.useState(function () { return fn(registry); })[0]; | ||
var bloc = React.useMemo(function () { return fn(registry); }, [registry]); | ||
return bloc; | ||
@@ -43,3 +43,3 @@ } | ||
}; | ||
}, []); | ||
}, [bloc]); | ||
return state; | ||
@@ -46,0 +46,0 @@ } |
{ | ||
"name": "@bloc-js/react-bloc", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "React components for implementing the BLoC pattern.", | ||
@@ -50,3 +50,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "b75b079923a3cf8b33ea55052a28dbe87b3b6436" | ||
"gitHead": "09361a9f986526ba4f53a913176580a8c900c1d4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42373