`getContextChangedKeys` only handles class components:
https://github.com/facebook/react/blob/355591add41c0f6dad738fdb1b6603e0786b7b4e/packages/react-devtools-shared/src/backend/renderer.js#L1276-L1304
For example, we could add a new recursive unmount tree operation.
   The unmount operations are already significantly smaller than mount operations though.
   This is something to keep in mind for later.
  function updateComponentFilters(componentFilters: Array<ComponentFilter>) {
    if (isProfiling) {
       R
       I
      throw Error('Cannot modify filter preferences while profiling');
    }
     Recursively unmount all roots.
    hook.getFiberRoots(rendererID).forEach(root => {
      currentRootID = getOrGenerateFiberID(root.current);
       T
       1
       2
      pushOperation(TREE_OPERATION_REMOVE_ROOT);
      flushPendingEvents(root);
      currentRootID = -1;
    });
    applyComponentFilters(componentFilters);
     Reset pseudo counters so that new path selections will be persisted.
    rootDisplayNameCounter.clear();
     Recursively re-mount all roots with new filter criteria applied.
    hook.getFiberRoots(rendererID).forEach(root => {
      currentRootID = getOrGenerateFiberID(root.current);
      setRootPseudoKey(currentRootID, root.current);
      mountFiberRecursively(root.current, null, false, false);
      flushPendingEvents(root);
      currentRootID = -1;
    });