Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility issue? #1402

Open
ghost opened this issue Nov 20, 2023 · 1 comment
Open

Compatibility issue? #1402

ghost opened this issue Nov 20, 2023 · 1 comment
Labels
wontfix This will not be worked on

Comments

@ghost
Copy link

ghost commented Nov 20, 2023

Describe the bug
A clear and concise description of what the bug is.

When using gridjs v6.0.6, gridjs-react v6.0.1, NextJS 14 I get the following error

[Grid.js] [ERROR]: The container element [object HTMLDivElement] is not empty. Make sure the container is empty and call render() again

Code

'use client'

import { Grid } from 'gridjs-react'
import useSWR from 'swr'

const fetcher = (url) => fetch(url).then((r) => r.json())

export default function WebsiteTable() {
 const { data, error } = useSWR('/api/websites/get', fetcher)
 if (error) return <div>Error: {error.message}</div>
 if (!data) return <div>Loading...</div>

 const websites = data.websites

 const columns = [
  { id: 'id', name: 'ID', type: 'text' },
  { id: 'domain', name: 'Domain', type: 'text' },
 ];

 const rows = websites.map((website) => ({
  id: website.id,
  domain: website.domain
 }));

 return (
  <Grid
   columns={columns}
   data={rows}
  />
 )
}
Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

0 participants