fix: "Add to Twenty" button render fix (chrome-extension) (#5048)
fix - #5047
This commit is contained in:
@ -2,6 +2,8 @@ import { useEffect, useState } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export type ToggleSize = 'small' | 'medium';
|
||||
|
||||
type ContainerProps = {
|
||||
@ -54,7 +56,7 @@ export const Toggle = ({
|
||||
const handleChange = () => {
|
||||
setIsOn(!isOn);
|
||||
|
||||
if (onChange) {
|
||||
if (isDefined(onChange)) {
|
||||
onChange(!isOn);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user