LogBox: Intelligently Un-Collapse Stack Frames
Summary: Tweaks LogBox so that if all stack frames are collapsed, start off without collapsing any of them. It saves developers from one extra interaction to make the LogBox actually useful for errors where every frame is ignored. Changelog: [General][Changed] - LogBox will not initially collapse stack frames if every frame would be collapsed. Differential Revision: D26266195 fbshipit-source-id: dcdbe0834da5fc3a0bf49fb7857de30dd7e4b8cb
This commit is contained in:
Родитель
7f5ec15009
Коммит
88a41f180c
|
@ -63,7 +63,10 @@ export function getCollapseMessage(
|
|||
}
|
||||
|
||||
function LogBoxInspectorStackFrames(props: Props): React.Node {
|
||||
const [collapsed, setCollapsed] = React.useState(true);
|
||||
const [collapsed, setCollapsed] = React.useState(() => {
|
||||
// Only collapse frames initially if some frames are not collapsed.
|
||||
return props.log.getAvailableStack().some(({collapse}) => !collapse);
|
||||
});
|
||||
|
||||
function getStackList() {
|
||||
if (collapsed === true) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче