Skip to content

Commit

Permalink
refactor(highlight-code): add UNSAFE prefix for lifecycle methods
Browse files Browse the repository at this point in the history
Refs #7497
  • Loading branch information
char0n committed Oct 8, 2021
1 parent 305f7c3 commit 227b932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/components/highlight-code.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export default class HighlightCode extends Component {
}
}

componentDidMount() {
UNSAFE_componentDidMount() {
[this.#syntaxHighlighter, this.#pre]
.map(element => element?.addEventListener("mousewheel", this.preventYScrollingBeyondElement, { passive: false }))
}

componentWillUnmount() {
UNSAFE_componentWillUnmount() {
[this.#syntaxHighlighter, this.#pre]
.map(element => element?.removeEventListener("mousewheel", this.preventYScrollingBeyondElement))
}
Expand Down

0 comments on commit 227b932

Please sign in to comment.