Skip to content

grid/jsx-components - #13

Open
sebastianbochan wants to merge 69 commits into
mainfrom
grid/jsx-components
Open

grid/jsx-components#13
sebastianbochan wants to merge 69 commits into
mainfrom
grid/jsx-components

Conversation

@sebastianbochan

@sebastianbochan sebastianbochan commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Added JSX-based Grid configuration.


TODO

Architecture

  • - Options as optional prop
  • - Added DOM children
  • - Options parser

Components

Pagination

Layout handling

  • - Collect and detect Grid child components
  • - Test

Header - optional

Tooling / Tests

Grid Pro

Tailwind

Docs

Demos

  • - Grid Lite with tailwind
  • - Grid Pro with tailwind
  • - Add nextJS Grid Lite demo
  • - Add nextJS Grid Pro demo

@sebastianbochan sebastianbochan self-assigned this Jun 22, 2026
@sebastianbochan sebastianbochan added the Feature New feature or request label Jun 22, 2026

@KamilKubik KamilKubik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks and works as intendent, excellent work!

I have a few suggestions below:


// Prevent double initialization
if (initStartedRef.current || currGridRef.current) {
return;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to the latest changes, but it can create a serious issue when strict mode is on. Because it then mounts twice, there's no proper cleanup (only in the dev environment). I think it would be ideal to always return the cleanup instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD

return (child.props ?? {}) as Record<string, unknown>;
}

function renderChildren(children: ReactNode): string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that the support here is very basic, even too basic in my opinion, since users aren't allowed to pass their own components, like:

<Caption><div>Team directory</div></Caption>

or, more precisely:

const Component = () => <div>Team directory</div>;
<Caption><Component /></Caption>

I think this is crucial for the integration, but on the other hand, the topic is very complex, since we don't render such components, so React lifecycle-dependent operations aren't supported.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid that its really complex, especially that we should support it in every component then. I'm sceptical at the first version of this integration.

Comment on lines +138 to +144
<Column
headerFormat="#"
width={40}
cellValueGetter={function (this: { row: { index: number } }) {
return String(this.row.index + 1);
}}
/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Grid core, id is required, but the integration serves both id and columnId, and neither is required. Not sure why we have both, but I think we should require at least one. Also, I think that's the reason we have this "dead" (unless I'm missing something) column here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if not providing the position prop is the right call, since it's defined in the API and might not be obvious to users that positioning depends on the JSX structure. Have you considered providing it, following the established priority (for example, position over prop)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced to any option, cause position element in markup is more intuitive than using parameter "position" as a component's props.

Comment thread packages/grid-lite-react/package.json Outdated
);
const gridOptions = useMemo(
() => build(childOptions, options),
[childOptions, options, ...buildDeps]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly recommend installing the eslint-plugin-react-hooks plugin, which should show an error here (and potentially in other places).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No errors here, only warning. TBD.

Comment thread packages/grid-pro-react/package.json Outdated
@sebastianbochan
sebastianbochan requested a review from stitot August 17, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants