-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Promote editor2 #2149
Promote editor2 #2149
Conversation
nstepien
commented
Sep 4, 2020
•
edited
Loading
edited
- Changelog
- Removed support for the old editor API completely
|
||
export function useCombinedRefs<T>(...refs: readonly React.Ref<T>[]) { | ||
return useMemo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://reactjs.org/docs/hooks-reference.html#usememo
You may rely on useMemo as a performance optimization, not as a semantic guarantee. In the future, React may choose to “forget” some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components. Write your code so that it still works without
useMemo
— and then add it to optimize performance.
Looks like useCallback
is safer than useMemo
for this hook 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reviewing. A few comments so far
@@ -3,7 +3,7 @@ import { mount } from 'enzyme'; | |||
|
|||
import Cell from './Cell'; | |||
import helpers, { Row } from './test/GridPropHelpers'; | |||
import { SimpleCellFormatter } from './formatters'; | |||
import { ValueFormatter } from './formatters'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -156,7 +134,7 @@ export interface EditCellProps<TRow> extends SelectedCellPropsBase { | |||
mode: 'EDIT'; | |||
editorPortalTarget: Element; | |||
editorContainerProps: SharedEditorContainerProps; | |||
editor2Props: SharedEditor2Props<TRow>; | |||
editorProps: SharedEditorProps<TRow>; | |||
} | |||
|
|||
export interface SelectedCellProps extends SelectedCellPropsBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point we should revisit the exported types. We may not want to export everything