@amplifyup/sdk 0.1.53 → 0.1.54

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.
@@ -2947,11 +2947,9 @@ var refreshEventTracking = () => getSDK().refreshEventTracking();
2947
2947
  getSDK();
2948
2948
  react.createContext(null);
2949
2949
  function useLiveComposerProps(layoutNodeId, props) {
2950
- const [live, setLive] = react.useState(props);
2951
- react.useEffect(() => {
2952
- setLive(props);
2953
- }, [props]);
2950
+ const [patch, setPatch] = react.useState(null);
2954
2951
  react.useEffect(() => {
2952
+ setPatch(null);
2955
2953
  const matchesNode = (nodeId) => {
2956
2954
  if (nodeId && layoutNodeId && String(nodeId) !== String(layoutNodeId)) {
2957
2955
  return false;
@@ -2961,15 +2959,15 @@ function useLiveComposerProps(layoutNodeId, props) {
2961
2959
  const applyField = (fieldName, value, nodeId) => {
2962
2960
  if (!fieldName || typeof fieldName !== "string") return;
2963
2961
  if (!matchesNode(nodeId)) return;
2964
- setLive((prev) => ({ ...prev, [fieldName]: value }));
2962
+ setPatch((prev) => ({ ...prev || {}, [fieldName]: value }));
2965
2963
  };
2966
2964
  const applyProps = (nextProps, nodeId) => {
2967
2965
  if (!nextProps || typeof nextProps !== "object" || Array.isArray(nextProps)) {
2968
2966
  return;
2969
2967
  }
2970
2968
  if (!matchesNode(nodeId)) return;
2971
- setLive((prev) => ({
2972
- ...prev,
2969
+ setPatch((prev) => ({
2970
+ ...prev || {},
2973
2971
  ...nextProps
2974
2972
  }));
2975
2973
  };
@@ -2998,7 +2996,7 @@ function useLiveComposerProps(layoutNodeId, props) {
2998
2996
  window.removeEventListener("message", onMessage);
2999
2997
  };
3000
2998
  }, [layoutNodeId]);
3001
- return live;
2999
+ return patch ? { ...props, ...patch } : props;
3002
3000
  }
3003
3001
  var usePathname = null;
3004
3002
  if (typeof window !== "undefined") {