#Document is not defined

3 messages · Page 1 of 1 (latest)

tropic wing
#

I'm using react with glid-data-grid package, that package manipulate document for canvas view. What the best strategic to fix this issue ?

example page

---
import DashboardLayout from "../layouts/DashboardLayout.astro";
import Table from "./../components/Table.jsx";
---

<DashboardLayout>
  <Table client:load />
</DashboardLayout>

some code from the lib

...
    };
  }
  componentDidMount() {
    document.addEventListener("mousedown", this.clickOutside, true);
    document.addEventListener("contextmenu", this.clickOutside, true);
  }
  componentWillUnmount() {
    document.removeEventListener("mousedown", this.clickOutside);
    document.removeEventListener("contextmenu", this.clickOutside);
  }
  render() {
    const { onClickOutside, ...rest } = this.props;
...
tropic wing
#

ah silly me, it's now working. change client:load to client:only="react"

void wyvern
#

Hi @tropic wing That is great to hear, I take it everything is going okay now?