Skip to content

Remote data operations samples update to 19 #781

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

Merged
merged 5 commits into from
May 14, 2025

Conversation

tishko0
Copy link
Contributor

@tishko0 tishko0 commented May 8, 2025

No description provided.

@tishko0 tishko0 changed the title update(sample): updated infinite scroll to work with v19 packages Remote data operations samples update to 19 May 12, 2025
@dkamburov dkamburov changed the base branch from vnext to v19-updates May 14, 2025 08:15
Comment on lines 1 to 5
import React, { useEffect, useRef } from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';

import { IgrForOfStateEventArgs, IgrGridModule } from 'igniteui-react-grids';
import { IgrForOfState } from 'igniteui-react-grids';
Copy link
Member

@damyanpetev damyanpetev May 14, 2025

Choose a reason for hiding this comment

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

React and IgrForOfState are unused
Edit: Strike that last, JSX silliness requires React in scope

});
}, []);

function handlePreLoad(e: IgrForOfStateEventArgs) {
Copy link
Member

Choose a reason for hiding this comment

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

and IgrForOfStateEventArgs isn't imported, possibly typo on the unused IgrForOfState import? If so, you can change the import name

import "./index.css";

import { IgrGrid, IgrPaginator, IgrGridModule, GridPagingMode } from "igniteui-react-grids";
import { IgrGrid, IgrPaginator, GridPagingMode } from "igniteui-react-grids";
Copy link
Member

Choose a reason for hiding this comment

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

GridPagingMode is unused

import ReactDOM from 'react-dom/client';
import './index.css';

import { IgrForOfStateEventArgs, IgrGridModule } from 'igniteui-react-grids';
import { IgrForOfState } from 'igniteui-react-grids';
import { IgrGrid, IgrColumn } from 'igniteui-react-grids';
import { loadDataForPage, getCachedData } from './NwindService';

import 'igniteui-react-grids/grids/combined';
Copy link
Member

Choose a reason for hiding this comment

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

Oh forget this is also very much not needed, though will prob be mass-removed

Comment on lines 12 to 13
const grid = useRef<IgrGrid>(null);
const paginator = useRef<IgrPaginator>(null);
Copy link
Member

Choose a reason for hiding this comment

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

Also in general, refrain from manipulating state through refs - if you're seeing useRef in the sample and it's not being used to call methods - suspect its usage entirely and see if it can be replaced with state and bindings instead.
I.e.:
paginator totalRecords can and should be state that's bound to the paginator, that's the expected usage pattern and it should work

Copy link
Member

@damyanpetev damyanpetev left a comment

Choose a reason for hiding this comment

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

To avoid this sitting longer and more conflict resolutions, I've updated the imports (specifically one that'd error) so this can be merged. The "state instead of refs" comment is likely valid more broadly and can be addressed separately.

@damyanpetev damyanpetev merged commit b7a5c48 into v19-updates May 14, 2025
@damyanpetev damyanpetev deleted the ttonev/remote-data-operations-v19 branch May 14, 2025 12:20
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.

3 participants