Skip to content

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

@Mofitiani

Description

@Mofitiani

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 [email protected] 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions