diff --git a/samples/react-graph-cascading-managed-metadata/src/webparts/cascadingManagedMetadata/components/CascadingManagedMetadata.tsx b/samples/react-graph-cascading-managed-metadata/src/webparts/cascadingManagedMetadata/components/CascadingManagedMetadata.tsx index 56b9f313b..24477a3b0 100644 --- a/samples/react-graph-cascading-managed-metadata/src/webparts/cascadingManagedMetadata/components/CascadingManagedMetadata.tsx +++ b/samples/react-graph-cascading-managed-metadata/src/webparts/cascadingManagedMetadata/components/CascadingManagedMetadata.tsx @@ -19,11 +19,11 @@ const CascadingManagedMetadata: React.SFC = (pro const [coordinates, setCoordinates] = React.useState({ latitude: null, longitude: null }); React.useEffect(() => { - _getCountries().then(terms => { - const options: IDropdownOption[] = terms.value.map(t => ({ key: t.id, text: t.labels[0].name })); + _getCountries().then(countries => { + const options: IDropdownOption[] = countries.value.map(c => ({ key: c.id, text: c.labels[0].name })); setCountriesList(options); }); - }); + }, []); //* Get the country terms i.e. level 1 children using Graph const _getCountries = async (): Promise => {