Skip to content

Commit

Permalink
The observer is null if user prefers reduced motion
Browse files Browse the repository at this point in the history
Turns out TypeScript is there for a reason and shouldn't be bypassed. Fixes GoogleChromeLabs#1135
  • Loading branch information
jakearchibald committed Aug 25, 2021
1 parent 0d35fbd commit 6e427f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/prerendered-app/Intro/SlideOnScroll/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class SlideOnScroll extends Component<Props, State> {
// Have to manually disconnect due to memory leaks in browsers.
// One day we'll be able to remove this, and the private property.
// https://twitter.com/jaffathecake/status/1405437361643790337
this.observer!.disconnect();
if (this.observer) this.observer.disconnect();
}

render({ children }: RenderableProps<Props>) {
Expand Down

0 comments on commit 6e427f9

Please sign in to comment.