Merge pull request #859 from mirumee/SALEOR-1753-channel-picker-update-value

[1753] Update channel default choice on change
This commit is contained in:
Dominik Żegleń 2020-11-25 14:04:57 +01:00 committed by GitHub
commit b07c391af4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<ChannelPickerDialogProps> = ({
}) => {
const classes = useStyles({});
const intl = useIntl();
const [choice, setChoice] = useState(
const [choice, setChoice] = useStateFromProps(
defaultChoice || (!!channelsChoices.length ? channelsChoices[0].value : "")
);