File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
packages/react-devtools-shared/src/devtools/views/Components Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 7575 display : flex;
7676}
7777
78+ .CollapsableHeader [data-pending = "true" ] {
79+ cursor : progress;
80+ }
81+
7882.CollapsableHeaderIcon {
7983 flex : 0 0 1rem ;
8084 margin-left : -0.25rem ;
Original file line number Diff line number Diff line change 99
1010import { copy } from 'clipboard-js' ;
1111import * as React from 'react' ;
12- import { useState } from 'react' ;
12+ import { useState , useTransition } from 'react' ;
1313import Button from '../Button' ;
1414import ButtonIcon from '../ButtonIcon' ;
1515import KeyValue from './KeyValue' ;
@@ -101,6 +101,7 @@ function SuspendedByRow({
101101 maxTime,
102102} : RowProps ) {
103103 const [ isOpen , setIsOpen ] = useState ( false ) ;
104+ const [ openIsPending , startOpenTransition ] = useTransition ( ) ;
104105 const ioInfo = asyncInfo . awaited ;
105106 const name = useInferredName ( asyncInfo ) ;
106107 const description = ioInfo . description ;
@@ -144,7 +145,14 @@ function SuspendedByRow({
144145 < div className = { styles . CollapsableRow } >
145146 < Button
146147 className = { styles . CollapsableHeader }
147- onClick = { ( ) => setIsOpen ( prevIsOpen => ! prevIsOpen ) }
148+ data-pending = { openIsPending }
149+ onClick = { ( ) => {
150+ startOpenTransition ( ( ) => {
151+ setIsOpen ( prevIsOpen => ! prevIsOpen ) ;
152+ } ) ;
153+ } }
154+ // Changing the title on pending transition will not be visible since
155+ // (Reach?) tooltips are dismissed on activation.
148156 title = {
149157 longName +
150158 ' — ' +
You can’t perform that action at this time.
0 commit comments