How to import ObjectUtils
Posted: 06 Jul 2021, 19:05
I am following the linked example to create my own sortFunction for the DataTable:
https://github.com/primefaces/primereact/issues/348
My sortFunction is working, but I could not figure out how to import ObjectUtils from the PrimeReact library in my React application. I ended up copying and pasting the resolveFieldData and isFunction functions from ObjectUtils.js into my file as a workaround.
In the sample I see : import ObjectUtils from '../../components/utils/ObjectUtils';
I have tried :
import ObjectUtils from 'primereact/utils/Utils';
import {ObjectUtils} from 'primereact/utils/Utils'
import ObjectUtils from 'primereact/utils/ObjectUtils'
all with no luck. Is there a way to import this class into my React component?
Thanks
https://github.com/primefaces/primereact/issues/348
My sortFunction is working, but I could not figure out how to import ObjectUtils from the PrimeReact library in my React application. I ended up copying and pasting the resolveFieldData and isFunction functions from ObjectUtils.js into my file as a workaround.
In the sample I see : import ObjectUtils from '../../components/utils/ObjectUtils';
I have tried :
import ObjectUtils from 'primereact/utils/Utils';
import {ObjectUtils} from 'primereact/utils/Utils'
import ObjectUtils from 'primereact/utils/ObjectUtils'
all with no luck. Is there a way to import this class into my React component?
Thanks