Skip to content

Commit 028323f

Browse files
committed
refactor: update default props for onButtonClick and onMessageClick in useEmbeddedView
1 parent 094fa0c commit 028323f

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/embedded/components/IterableEmbeddedNotification/IterableEmbeddedNotification.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { styles } from './IterableEmbeddedNotification.styles';
1515
export const IterableEmbeddedNotification = ({
1616
config,
1717
message,
18-
onButtonClick = () => {},
19-
onMessageClick = () => {},
18+
onButtonClick,
19+
onMessageClick,
2020
}: IterableEmbeddedComponentProps) => {
2121
const { parsedStyles, handleButtonClick, handleMessageClick } =
2222
useEmbeddedView(IterableEmbeddedViewType.Notification, {
@@ -41,7 +41,6 @@ export const IterableEmbeddedNotification = ({
4141
} as ViewStyle,
4242
]}
4343
>
44-
{}
4544
<View style={styles.bodyContainer}>
4645
<Text
4746
style={[

src/embedded/hooks/useEmbeddedView/useEmbeddedView.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import type { IterableEmbeddedMessageElementsButton } from '../../types/Iterable
66
import { getMedia } from './getMedia';
77
import { getStyles } from './getStyles';
88

9+
const noop = () => {};
10+
911
/**
1012
* This hook is used to manage the lifecycle of an embedded view.
1113
*
@@ -36,8 +38,8 @@ export const useEmbeddedView = (
3638
{
3739
message,
3840
config,
39-
onButtonClick = () => {},
40-
onMessageClick = () => {},
41+
onButtonClick = noop,
42+
onMessageClick = noop,
4143
}: IterableEmbeddedComponentProps
4244
) => {
4345
const parsedStyles = useMemo(() => {

0 commit comments

Comments
 (0)