0

I'm using a lib called react-tooltip with a framework called react-static.

But the problem is that it doesn't support SSR and I'm having some issues with it during the build time.

enter image description here

I also tried to verify the document and if it's undefined return null

  if (typeof document === "undefined") {
    return null;
  }

  return (
    <div className="inline-flex text-grey-darker">
      <span data-tip data-for={tooltipId}>
        <IconInfoSmall />
      </span>
      <ReactTooltip
        id={tooltipId}
        effect="solid"
        type="light"
        border
        borderColor="#969696"
        className={`info-tooltip ${small ? 'w-60' : 'w-90'}`}
        clickable
      >

But nothing works... Anyone had been through this problem? Was is the best approach to deal with it?

Laura Beatris
  • 1,782
  • 7
  • 29
  • 49
  • You should add the code where you're calling `document`. – jmargolisvt Jul 18 '20 at 23:12
  • My bad. Just added – Laura Beatris Jul 18 '20 at 23:14
  • Unable to replicate your issue. Ran a local build using [react-static's quick start](https://github.com/react-static/react-static#quick-start), it compiled and appears to be working: [code](https://i.imgur.com/UnFVJiI.png), [build in production](https://i.imgur.com/YHlcOiD.png), [react in production](https://i.imgur.com/MgY5vYU.png), [tooltip in production](https://i.imgur.com/jZmQaMf.png), and [package dependencies](https://i.imgur.com/SftEqFL.png). – Matt Carlotta Jul 19 '20 at 00:39

0 Answers0