@prismicio/react 2.0.3-debug.2 → 2.0.5
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/dist/index.cjs +23 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +429 -0
- package/dist/index.mjs +23 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -11
- package/src/PrismicProvider.tsx +2 -3
- package/src/PrismicRichText.tsx +23 -11
- package/src/PrismicText.tsx +1 -2
- package/src/PrismicToolbar.tsx +2 -2
- package/src/SliceZone.tsx +2 -3
- package/src/usePrismicContext.ts +2 -2
- package/src/usePrismicPreviewResolver.ts +2 -2
- package/src/useStatefulPrismicClientMethod.ts +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as prismic from "@prismicio/client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
import { PrismicClientHookState } from "./types";
|
|
6
6
|
import { usePrismicClient } from "./usePrismicClient";
|
|
@@ -133,11 +133,11 @@ export const useStatefulPrismicClientMethod = <
|
|
|
133
133
|
|
|
134
134
|
const client = usePrismicClient(explicitClient || lastArgExplicitClient);
|
|
135
135
|
|
|
136
|
-
const [state, dispatch] = useReducer<
|
|
136
|
+
const [state, dispatch] = React.useReducer<
|
|
137
137
|
React.Reducer<StateMachineState<TData>, StateMachineAction<TData>>
|
|
138
138
|
>(reducer, initialState);
|
|
139
139
|
|
|
140
|
-
useEffect(
|
|
140
|
+
React.useEffect(
|
|
141
141
|
() => {
|
|
142
142
|
// Used to prevent dispatching an action if the hook was cleaned up.
|
|
143
143
|
let didCancel = false;
|
|
@@ -186,7 +186,7 @@ export const useStatefulPrismicClientMethod = <
|
|
|
186
186
|
],
|
|
187
187
|
);
|
|
188
188
|
|
|
189
|
-
return useMemo(
|
|
189
|
+
return React.useMemo(
|
|
190
190
|
() => [
|
|
191
191
|
state.data,
|
|
192
192
|
{
|