Skip to content

feat(CustomAgGridTable): expose useFieldArray via ref and relax props#1133

Open
flomillot wants to merge 1 commit into
mainfrom
florent/custom-ag-grid-table-forwardref
Open

feat(CustomAgGridTable): expose useFieldArray via ref and relax props#1133
flomillot wants to merge 1 commit into
mainfrom
florent/custom-ag-grid-table-forwardref

Conversation

@flomillot
Copy link
Copy Markdown
Contributor

@flomillot flomillot commented May 15, 2026

Summary

  • Wrap CustomAgGridTable in forwardRef + useImperativeHandle so a parent can drive the internal useFieldArray (replace, append, ...) without declaring a second useFieldArray on the same name (forbidden by react-hook-form).
  • Relax the props type so only columnDefs is required. defaultColDef, pagination, paginationPageSize, alwaysShowVerticalScroll, stopEditingWhenCellsLoseFocus, rowSelection, overrideLocales are now optional. loading is exposed too.
  • Default stopEditingWhenCellsLoseFocus to true (matches every current caller).
  • Remove hardcoded rowDragManaged (not compatible with pagination per AG Grid docs) and rowDragEntireRow. Consumers opt into row drag via rowDrag: true on a column.
  • Drop the now-redundant stopEditingWhenCellsLoseFocus prop on ExplicitNamingFilterForm.

Motivated by gridstudy-app's tabular-modification dialog that needs to load CSV-parsed rows imperatively into the grid. Consumer PRs:

Wrap CustomAgGridTable in forwardRef + useImperativeHandle so parents
can drive the underlying field array imperatively (replace/append/...)
when their own data flow (e.g. external CSV parsing) needs to load
rows into the table. This avoids declaring a second useFieldArray on
the same name, which react-hook-form forbids.

Also:
- Relax the props type: only columnDefs stays required; defaultColDef,
  pagination, paginationPageSize, alwaysShowVerticalScroll,
  stopEditingWhenCellsLoseFocus, rowSelection and overrideLocales are
  now optional. Expose loading as well.
- Default stopEditingWhenCellsLoseFocus to true (matches the way every
  current caller uses it).
- Drop the hardcoded rowDragManaged (not compatible with pagination
  per AG Grid docs) and rowDragEntireRow. Consumers opt into row drag
  by setting rowDrag: true on a column, which is AG Grid's default
  drag handle.
- Drop the now-redundant stopEditingWhenCellsLoseFocus prop in
  ExplicitNamingFilterForm.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@flomillot has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 51 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7552573-8586-4e88-82e5-2fe12f7aa588

📥 Commits

Reviewing files that changed from the base of the PR and between d0d88dd and c2c4011.

📒 Files selected for processing (2)
  • src/components/filter/explicitNaming/ExplicitNamingFilterForm.tsx
  • src/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.tsx

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant