GithubHelp home page GithubHelp logo

Comments (3)

modulitos avatar modulitos commented on May 14, 2024 1

After further investigation, it looks like this issue isn't with react-share, but instead it has to do with adding meta tags and allowing bots to parse the page.

I am currently solving this issue by adding my meta tags via react-helmet and pre-rendering the page via prerender.io. Hopefully this helps somebody!

Closing this issue for now.

from react-share.

matewilk avatar matewilk commented on May 14, 2024 1

Is this a complete example ? I'm trying to react-share with an image on the client side only. I have a standard index.html file, and I included react-helmet into my component that is suppose to display the iframe share with an image.

I tried many variations with property, name etc as keys, still nothing.

Render method looks like this:

render () {
    const {
      TwitterShareButton
    } = ShareButtons;
    const TwitterIcon = generateShareIcon('twitter');

    let shareUrl = 'http://example.com';
    let title = 'Title for the tweet';
    return (
      <div className='twitter-share-button-container'>
      <Helmet
        base={{href: `${window.location.path}`}}
        title="My Title"
        meta={[
          {"name": "twitter:card", "content": "summary_large_image"},
          {"property": "twitter:site", "content": "@twitteruser"},
          {"property": "twitter:title", "content": "content goes here"},
          {"property": "twitter:description", "content": "description"},
          {"property": "twitter:image", "content": "http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg"},
          {"property": "og:image", "content": "http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg"}
        ]}
        />
        <div className='share-text'>
          <Subheader >share</Subheader>
        </div>
        <TwitterShareButton
          url={shareUrl}
          title={title}
          hashtags={['test', 'test2']}>
          <TwitterIcon
            size={32}
            round />
        </TwitterShareButton>
      </div>
    );
  }

The share window is of course displayed, but there is no difference no matter if I use helmet or not.

The title of the browser tab changes correctly though.

Any help much appreciated.

Thanks!

from react-share.

buddies2705 avatar buddies2705 commented on May 14, 2024

Did you solved the problem?

from react-share.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.