Skip to content
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

Merged
merged 37 commits into from
Oct 29, 2020
Merged

Promote editor2 #2149

merged 37 commits into from
Oct 29, 2020

Conversation

nstepien
Copy link
Contributor

@nstepien nstepien commented Sep 4, 2020

  • Changelog
  • Removed support for the old editor API completely

@nstepien nstepien self-assigned this Sep 4, 2020
@nstepien nstepien marked this pull request as ready for review September 9, 2020 17:13

export function useCombinedRefs<T>(...refs: readonly React.Ref<T>[]) {
return useMemo(
Copy link
Contributor Author

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 🤔

Copy link
Contributor

@amanmahajan7 amanmahajan7 left a 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';
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

src/DataGrid.tsx Outdated Show resolved Hide resolved
src/editors/TextEditor.tsx Show resolved Hide resolved
@@ -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 {
Copy link
Contributor

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

@nstepien nstepien merged commit 509963f into canary Oct 29, 2020
@nstepien nstepien deleted the promote-editor branch October 29, 2020 15:42
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.

None yet

2 participants