Skip to content

Commit

Permalink
change value of input when data.url changes from using the sidebar wi…
Browse files Browse the repository at this point in the history
…dget
  • Loading branch information
ichim-david committed May 26, 2024
1 parent 7b4a20a commit 108df8c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { SidebarPortal } from '@plone/volto/components';
import Data from './Data';
import type { BlockEditProps } from '@plone/types';
Expand All @@ -10,6 +10,10 @@ const InputBlockEdit = (props: BlockEditProps) => {
const { selected, block, data, onChangeBlock } = props;
const [url, setUrl] = React.useState(data?.url);

useEffect(() => {
setUrl(data?.url);
}, [data?.url]);

return (
<>
<div>Input Block Edit</div>
Expand Down

0 comments on commit 108df8c

Please sign in to comment.