From 15e830ff50dbc08cda15f41e2a9499bcc7e03ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20Nyga=CC=8Ard?= Date: Wed, 28 Feb 2024 09:48:19 +0200 Subject: [PATCH] fix: prevent title from being passed to the button element --- .changeset/late-horses-enjoy.md | 5 +++++ src/ShareButton.tsx | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/late-horses-enjoy.md diff --git a/.changeset/late-horses-enjoy.md b/.changeset/late-horses-enjoy.md new file mode 100644 index 00000000..b95476d6 --- /dev/null +++ b/.changeset/late-horses-enjoy.md @@ -0,0 +1,5 @@ +--- +"react-share": patch +--- + +The `title` prop is no longer passed to the `button` element, which may have caused e.g. warnings in the console before. Note that to set the native `title` attribute for the share buttons, you may use the `htmlTitle` prop. diff --git a/src/ShareButton.tsx b/src/ShareButton.tsx index e51d32b3..40dde0c6 100644 --- a/src/ShareButton.tsx +++ b/src/ShareButton.tsx @@ -122,6 +122,8 @@ export default function ShareButton> opts, resetButtonStyle = true, style, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + title, // deconstructed from ...rest to prevent passing it to the button element url, windowHeight = 400, windowPosition = 'windowCenter',