Search code examples
reactjsreact-share

Styling issue with react-share button and text


When I am trying to add text in front of FacebookIcon by using react-share, the text is not aligned to the icon. I have gone through the docs but couldn`t find anything useful.

Sample code: https://codesandbox.io/s/rrlli?file=/src/App.js

Library home: https://www.npmjs.com/package/react-share

I have tried to add text in span tag and trying adding style but it didn`t work


Solution

  • the text is not aligned to the icon

    Then just apply a new className for the wrapper and set align-items to center.

    .align {
      display: flex;
      align-items: center;
    }
    

    https://codesandbox.io/s/react-share-facebook-and-twitter-example-forked-hcfhfk