Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The shared URL is not populated when sharing on Reddit #546

Open
Mofitiani opened this issue Sep 22, 2024 · 0 comments
Open

The shared URL is not populated when sharing on Reddit #546

Mofitiani opened this issue Sep 22, 2024 · 0 comments

Comments

@Mofitiani
Copy link

Mofitiani commented Sep 22, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Issue:
When sharing via Reddit, the link is not automatically populated

Proposed fix:
Appending '/web' as a route before '/submit' seems to fix the issue

Today I used patch-package to patch react-share@4.4.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-share/lib/RedditShareButton.js b/node_modules/react-share/lib/RedditShareButton.js
index dc8ea2a..da2a296 100644
--- a/node_modules/react-share/lib/RedditShareButton.js
+++ b/node_modules/react-share/lib/RedditShareButton.js
@@ -9,7 +9,7 @@ var createShareButton_1 = __importDefault(require("./hocs/createShareButton"));
 function redditLink(url, _a) {
     var title = _a.title;
     (0, assert_1.default)(url, 'reddit.url');
-    return ('https://www.reddit.com/submit' +
+    return ('https://www.reddit.com/web/submit' +
         (0, objectToGetParams_1.default)({
             url: url,
             title: title,

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant