fix current warnings
This commit is contained in:
@@ -57,13 +57,13 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleEscPress = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
closeModal();
|
||||
}
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
const handleEscPress = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
closeModal();
|
||||
}
|
||||
};
|
||||
|
||||
if (isOpen) {
|
||||
window.addEventListener('keydown', handleEscPress);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
|
||||
return () => {
|
||||
window.removeEventListener('keydown', handleEscPress);
|
||||
};
|
||||
}, [isOpen]);
|
||||
}, [isOpen, closeModal]);
|
||||
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useMemo } from "react";
|
||||
|
||||
|
||||
const FancyBackground = (): JSX.Element => {
|
||||
@@ -25,7 +25,7 @@ const FancyBackground = (): JSX.Element => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const App: any = {};
|
||||
const App: any = useMemo(() => [], []);
|
||||
|
||||
App.setup = function () {
|
||||
|
||||
@@ -335,7 +335,7 @@ const FancyBackground = (): JSX.Element => {
|
||||
requestAnimationFrame(frame);
|
||||
};
|
||||
frame();
|
||||
}, []);
|
||||
}, [App]);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user