Skip to content

Commit 383cec2

Browse files
authored
rp type safe access to ref to avoid breaking tests (#2913)
1 parent c261245 commit 383cec2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/hint/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class Hint extends Component<HintProps, HintState> {
227227

228228
if (!this.state.targetLayoutInWindow || this.props.onBackgroundPress) {
229229
setTimeout(() => {
230-
this.targetRef?.measureInWindow((x: number, y: number, width: number, height: number) => {
230+
this.targetRef?.measureInWindow?.((x: number, y: number, width: number, height: number) => {
231231
const targetLayoutInWindow = {x, y, width, height};
232232
this.setState({targetLayoutInWindow});
233233
});

0 commit comments

Comments
 (0)