Skip to content

Commit be43928

Browse files
author
Sasha Kondrashov
committed
embed
1 parent 1a31ae0 commit be43928

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/modules/Embed/Embed.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ export interface StrictEmbedProps {
5959
* Called on click.
6060
*
6161
* @param {SyntheticEvent} event - React's original SyntheticEvent.
62-
* @param {object} data - All props and proposed value.
62+
* @param {object} props - All props.
63+
* @param {boolean} active - Whether the embed is active.
6364
*/
64-
onClick?: (event: React.MouseEvent<HTMLDivElement>, data: EmbedProps) => void
65+
onClick?: (event: React.MouseEvent<HTMLDivElement>, props: EmbedProps, active: boolean) => void
6566

6667
/** A placeholder image for embed. */
6768
placeholder?: string

src/modules/Embed/Embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const Embed = React.forwardRef(function (props, ref) {
7070
}
7171

7272
const handleClick = (e) => {
73-
_.invoke(props, 'onClick', e, { ...props, active: true })
73+
_.invoke(props, 'onClick', e, props, true)
7474
if (!active) {
7575
setActive(true)
7676
}

0 commit comments

Comments
 (0)