Skip to content

Commit c5f0434

Browse files
call dropdown initial onSelect before component-under-test render (#37)
1 parent dd7751a commit c5f0434

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/viewer/ComponentViewer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class ComponentViewer extends Component<Props, ComponentViewerState> {
5555
[globalActionDefaultKeys.prevDemoEntry]: this.onPrevDemoEntry,
5656
...this.dropDownKeyBoundActions()
5757
};
58+
59+
this.triggerDropDownSelection();
5860
}
5961

6062
render() {
@@ -158,7 +160,6 @@ class ComponentViewer extends Component<Props, ComponentViewerState> {
158160
}
159161

160162
componentDidMount() {
161-
this.updateStateFromUrl(this.triggerDropDownSelection);
162163
this.subscribeToUrlChanges();
163164
}
164165

src/demos/ProfileScreenDemo.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as React from 'react';
22

33
export function ProfileScreenDemo() {
4+
console.log('ProfileScreen');
5+
46
return (
57
<div>Profile Screen</div>
68
);

0 commit comments

Comments
 (0)