TypeScript type mismatch for `ajax` and `options.ajax` props
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start with the documented usage in Readme.md at the linked section and reproduce the type error in the provided StackBlitz example. Trace the TypeScript definitions for the ajax and options.ajax props, then verify that the documented url form is accepted without an error while the table still loads data as shown.
Written by the indexing model from the issue text.
Description
Hello, and thank you for developing this React component for DataTables.
I found that both the ajax prop and options.ajax prop work fine in practice, but they produce a TypeScript type error. The current type definition doesn’t seem to match what is described in the DataTables documentation:
Error message:
Object literal may only specify known properties, and 'url' does not exist in type 'AjaxSettings | FunctionAjax'.
You can reproduce the issue here:
https://stackblitz.com/edit/datatables-net-react-ajax-xmq14ri7?file=src%2FApp.tsx
In the example, the table renders correctly and data is loaded as expected, but TypeScript still reports a type error for the ajax option. As a short-term workaround, I’m currently adding @ts-expect-error above the line to suppress the error.
Could the type definition be updated to match the documented and working behavior?
Thanks again for building and maintaining this component.
- Dominant language
- TypeScript
- Stars
- 6
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataTables/React
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
DataTables/React#7 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataTables/React#6 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 67/100
DataTables/React#4 · 14 comments ·
All issues in DataTables/React
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·