Home / File/ SuspenseScrubber.js — react Source File

SuspenseScrubber.js — react Source File

Architecture documentation for SuspenseScrubber.js, a javascript file in the react codebase. 7 imports, 1 dependents.

File javascript BabelCompiler 7 imports 1 dependents

Entity Profile

Dependency Diagram

graph LR
  a780c065_6e09_9761_ec53_ece3335378f1["SuspenseScrubber.js"]
  22e0e039_6e6e_09fd_7427_d1d26f90ac35["SuspenseScrubber.css"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> 22e0e039_6e6e_09fd_7427_d1d26f90ac35
  0e3e3ccf_5730_dd0d_ff2f_15f01903193c["SuspenseEnvironmentColors.js"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> 0e3e3ccf_5730_dd0d_ff2f_15f01903193c
  bb73063d_5d08_efb3_036e_72b78842d689["tooltip.js"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> bb73063d_5d08_efb3_036e_72b78842d689
  913bb343_55ea_f1b8_08f5_b75cb0a92b76["context.js"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  aec7978f_0a19_ba93_de9e_ac8cf5ddc74b["types"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> aec7978f_0a19_ba93_de9e_ac8cf5ddc74b
  ebb48597_9981_bb7d_08db_b9fe29a0f62e["SyntheticEvent"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> ebb48597_9981_bb7d_08db_b9fe29a0f62e
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  a780c065_6e09_9761_ec53_ece3335378f1 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  09a08def_3d86_aab5_1719_24f5fdd9d175["SuspenseTimeline.js"]
  09a08def_3d86_aab5_1719_24f5fdd9d175 --> a780c065_6e09_9761_ec53_ece3335378f1
  style a780c065_6e09_9761_ec53_ece3335378f1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import type {SuspenseTimelineStep} from 'react-devtools-shared/src/frontend/types';

import typeof {SyntheticEvent} from 'react-dom-bindings/src/events/SyntheticEvent';

import * as React from 'react';
import {useContext, useRef} from 'react';
import {ElementTypeRoot} from 'react-devtools-shared/src/frontend/types';

import styles from './SuspenseScrubber.css';

import {getClassNameForEnvironment} from './SuspenseEnvironmentColors.js';

import Tooltip from '../Components/reach-ui/tooltip';
import {StoreContext} from '../context';

export default function SuspenseScrubber({
  min,
  max,
  timeline,
  value,
  highlight,
  onBlur,
  onChange,
  onFocus,
  onHoverSegment,
  onHoverLeave,
}: {
  min: number,
  max: number,
  timeline: $ReadOnlyArray<SuspenseTimelineStep>,
  value: number,
  highlight: number,
  onBlur?: () => void,
  onChange: (index: number) => void,
  onFocus?: () => void,
  onHoverSegment: (index: number) => void,
  onHoverLeave: () => void,
}): React$Node {
  const store = useContext(StoreContext);
  const inputRef = useRef();
  function handleChange(event: SyntheticEvent) {
    const newValue = +event.currentTarget.value;
    onChange(newValue);
  }
  function handlePress(index: number, event: SyntheticEvent) {
    event.preventDefault();
    if (inputRef.current == null) {
      throw new Error(
        'The input should always be mounted while we can click things.',
      );
    }
// ... (65 more lines)

Domain

Frequently Asked Questions

What does SuspenseScrubber.js do?
SuspenseScrubber.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does SuspenseScrubber.js depend on?
SuspenseScrubber.js imports 7 module(s): SuspenseEnvironmentColors.js, SuspenseScrubber.css, SyntheticEvent, context.js, react, tooltip.js, types.
What files import SuspenseScrubber.js?
SuspenseScrubber.js is imported by 1 file(s): SuspenseTimeline.js.
Where is SuspenseScrubber.js in the architecture?
SuspenseScrubber.js is located at packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseScrubber.js (domain: BabelCompiler, directory: packages/react-devtools-shared/src/devtools/views/SuspenseTab).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free