static getDerivedStateFromProps()

in src/components/QueryEditor.tsx [105:120]


  static getDerivedStateFromProps(
    nextProps: QueryEditorProps<TimeBaseDataSource, TimeBaseQuery, MyDataSourceOptions>, 
    prevState: QueryEditorState) {
      const selectedSymbolsProp = nextProps.query.selectedSymbols;
      const symbolsInList = selectedSymbolsProp?.every(s => prevState.symbols.includes(s));
      const selectedSymbols = selectedSymbolsProp?.length && symbolsInList ? selectedSymbolsProp.map(toOption) : [toOption(ALL_KEY)];

      const validSymbolControl = !selectedSymbolsProp?.length || !!selectedSymbolsProp.includes(ALL_KEY) || 
        selectedSymbolsProp.filter(Boolean).every(s => prevState.symbols.includes(s as string));

    return {
      selectedStream: nextProps.query.selectedStream == null ? null : toOption(nextProps.query.selectedStream),
      selectedSymbol: selectedSymbols,
      validSymbolControl
    };
  }