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

Some DataView lazy and loading types missing #1131

Closed
PaulInglis opened this issue Dec 20, 2019 · 1 comment
Closed

Some DataView lazy and loading types missing #1131

PaulInglis opened this issue Dec 20, 2019 · 1 comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@PaulInglis
Copy link
Contributor

PaulInglis commented Dec 20, 2019

There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours

I'm submitting a ... (check one with "x")

[*] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)
Please fork the codesandbox below and create a case demonstrating your bug report. Issues without a codesandbox have much less possibility to be reviewed.

https://codesandbox.io/s/primereact-test-zk43m

Current behavior

As per the documentation it specifies that there should be a lazy prop to "Defines if data is loaded and interacted with in lazy manner". Arguably there should also be a loading prop there too if it is to be aligned with DataTable, however it is noted that this is not implemented in DataView.
Currently adding the lazy prop into the DataView component gives the following compiler error:

No overload matches this call.
  Overload 1 of 2, '(props: Readonly<DataViewProps>): DataView', gave the following error.
    Type '{ value: any; lazy: true; itemTemplate: (data: any) => Element; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<DataView> & Readonly<DataViewProps> & Readonly<{ children?: ReactNode; }>'.
      Property 'lazy' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<DataView> & Readonly<DataViewProps> & Readonly<{ children?: ReactNode; }>'.
  Overload 2 of 2, '(props: DataViewProps, context?: any): DataView', gave the following error.
    Type '{ value: any; lazy: true; itemTemplate: (data: any) => Element; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<DataView> & Readonly<DataViewProps> & Readonly<{ children?: ReactNode; }>'.
      Property 'lazy' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<DataView> & Readonly<DataViewProps> & Readonly<{ children?: ReactNode; }>'.ts(2769)

Expected behavior

No compiler error and DataView deals with lazy loading data

Minimal reproduction of the problem with instructions

See codesandbox: https://codesandbox.io/s/primereact-test-zk43m

  • create DataView component with the lazy prop in any typescript file
  • observe compiler error

Please tell us about your environment:

Visual Code

  • React version:

16.9.0

  • PrimeReact version:

v3.3.3

  • Browser: [N/A]
  • Language: [TypeScript 3.6.2]
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Jan 17, 2020
@mertsincan mertsincan added this to the 3.4.0 milestone Jan 17, 2020
@mertsincan
Copy link
Member

Thanks a lot for the PR!

mertsincan added a commit that referenced this issue Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants