@contentful/field-editor-rich-text 2.3.18 → 2.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/field-editor-rich-text.cjs.development.js +4 -2
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +4 -2
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -2153,7 +2153,9 @@ function useFetchedEntity(_ref) {
|
|
|
2153
2153
|
getEntry = _useEntities.getEntry,
|
|
2154
2154
|
getAsset = _useEntities.getAsset;
|
|
2155
2155
|
|
|
2156
|
-
var store =
|
|
2156
|
+
var store = useMemo(function () {
|
|
2157
|
+
return type === 'Entry' ? entries : assets;
|
|
2158
|
+
}, [assets, entries, type]);
|
|
2157
2159
|
|
|
2158
2160
|
var _useState = useState(store == null ? void 0 : store[id]),
|
|
2159
2161
|
entity = _useState[0],
|
|
@@ -2182,7 +2184,7 @@ function useFetchedEntity(_ref) {
|
|
|
2182
2184
|
// TODO: consider rewriting useEntities() hook to avoid that happening in
|
|
2183
2185
|
// first place.
|
|
2184
2186
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: explain this disable
|
|
2185
|
-
}, [type, id]);
|
|
2187
|
+
}, [type, id, store]);
|
|
2186
2188
|
useEffect(function () {
|
|
2187
2189
|
if (entity) {
|
|
2188
2190
|
onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
|