mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-04 01:29:02 +00:00
Check if onChange is function
This commit is contained in:
parent
0c90e2d490
commit
523dda63a7
1 changed files with 3 additions and 1 deletions
|
|
@ -13,7 +13,9 @@ const ColorInput = ({ className, value, onChange }) => {
|
|||
const [selectedColor, setSelectedColor] = React.useState(value);
|
||||
|
||||
const confirmColorInput = React.useCallback(() => {
|
||||
onChange(selectedColor);
|
||||
if(typeof onChange === "function") {
|
||||
onChange(selectedColor);
|
||||
}
|
||||
closeColorInput();
|
||||
}, [selectedColor, onChange]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue