See #17798
if (element != null && element.props != null) {
        style = element.props.style || null;
      }
    }
    return {
      instance,
      style,
    };
  }
  function updateSelectedElement(id: number): void {
    const internalInstance = idToInternalInstanceMap.get(id);
    if (internalInstance == null) {
      console.warn(`Could not find instance with id "${id}"`);
      return;
    }
    switch (getElementType(internalInstance)) {
      case ElementTypeClass:
        global.$r = internalInstance._instance;
        break;
      case ElementTypeFunction:
        const element = internalInstance._currentElement;
        if (element == null) {
          console.warn(`Could not find element with id "${id}"`);
          return;
        }
        global.$r = {
          props: element.props,
          type: element.type,
        };
        break;