DevSettings

DevSettings talks to the development tooling. DevSettings.reload(reason) reloads the JavaScript bundle, and DevSettings.addMenuItem(title, handler) adds your own entry to the Dev Menu, which is handy for resetting state you would otherwise clear by hand:

src/info/DevMenu.tsx: a Dev Menu item that empties the cart (excerpt)TSX
  useEffect(() => {
    if (!__DEV__) return;
    DevSettings.addMenuItem('Empty the cart', () => {
      console.log('dev menu: emptying the cart');
      setCart(0);
    });
  }, []);

adb shell input keyevent 82 (the menu key) opened the Dev Menu with the new item at the bottom (right screen below); tapping it logged dev menu: emptying the cart and the screen changed to "Cart: 0 books". The __DEV__ guard keeps the code out of release builds, which have no Dev Menu.

Themed in light and dark mode (Sections 3.9.2 and 3.9.7), and the React Native Dev Menu with the added item
Themed in light and dark mode (Color Scheme and PlatformColor), and the React Native 36,878 Dev Menu with the added item