This is a migrated thread and some comments may be shown as answers.

Grid HOC usage

3 Answers 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matej
Top achievements
Rank 1
Veteran
Matej asked on 03 Sep 2019, 08:09 PM

Hi,

I was checking your HOC withState grid and can you give an example when this approach could be used? https://www.telerik.com/kendo-react-ui/components/grid/data-operations/local-operations/

Because it is possible to achieve the same behavior without the HOC like this https://stackblitz.com/edit/react-sn578k and I am just interested if there is any reason do it with HOC.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 04 Sep 2019, 07:34 AM

Hello, Matej,

Yes, this can be used without a HOC component, made the example to showcase how this abstraction can be made.

This is the data operation example without HOC:

https://stackblitz.com/edit/react-g3amdw?file=app/main.jsx

I hope this is helpful.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Matej
Top achievements
Rank 1
Veteran
answered on 04 Sep 2019, 10:53 AM

I still do not understand what is the right usage of that HOC used in the example on your page. Because right now we are using this StatefulGrid wrapper component without HOC https://stackblitz.com/edit/react-sn578k and I am curious if there are any advantages of using HOC with kendo grid component.

0
Stefan
Telerik team
answered on 05 Sep 2019, 06:16 AM

Hello, Matej,

The purpose of the HOC is to encapsulate a reusable logic.

For example, if in the application there will be a need to create a multiple similar Grid, the HOC can be used to write the logic and configuration once, and then just use this Grid approach many instances.

If inside the application there will be no similar Grid, then there is no need for the HOC.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Matej
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Matej
Top achievements
Rank 1
Veteran
Share this question
or