AG-3316 agGridReact needs to be updated to use the updated react lifecycle hooks
This commit is contained in:
18
src-examples/simpleReduxHooksExample/PriceFilter.jsx
Normal file
18
src-examples/simpleReduxHooksExample/PriceFilter.jsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React, {forwardRef, useImperativeHandle, useRef} from "react";
|
||||
|
||||
export default forwardRef((props, ref) => {
|
||||
const inputRef = useRef();
|
||||
useImperativeHandle(ref, () => {
|
||||
return {
|
||||
isFilterActive() {
|
||||
return inputRef.current.value !== '';
|
||||
},
|
||||
|
||||
doesFilterPass: (params) => {
|
||||
return params.data.price.toString() === inputRef.current.value;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return <input type="text" ref={inputRef} onChange={() => props.filterChangedCallback()}/>;
|
||||
})
|
||||
Reference in New Issue
Block a user