diff --git a/src/channels/components/ChannelPickerDialog/ChannelPickerDialog.tsx b/src/channels/components/ChannelPickerDialog/ChannelPickerDialog.tsx index 2d1efdf00..90a89e91e 100644 --- a/src/channels/components/ChannelPickerDialog/ChannelPickerDialog.tsx +++ b/src/channels/components/ChannelPickerDialog/ChannelPickerDialog.tsx @@ -4,7 +4,8 @@ import { Choices, SingleSelectField } from "@saleor/components/SingleSelectField"; -import React, { useState } from "react"; +import useStateFromProps from "@saleor/hooks/useStateFromProps"; +import React from "react"; import { useIntl } from "react-intl"; import { useStyles } from "../styles"; @@ -28,7 +29,7 @@ const ChannelPickerDialog: React.FC = ({ }) => { const classes = useStyles({}); const intl = useIntl(); - const [choice, setChoice] = useState( + const [choice, setChoice] = useStateFromProps( defaultChoice || (!!channelsChoices.length ? channelsChoices[0].value : "") );