Skip to content

Conversation

nstepien
Copy link
Collaborator

@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
import { useCallback } from 'react';

export function useCombinedRefs<T>(...refs: readonly React.Ref<T>[]) {
return useMemo(
Copy link
Collaborator 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
Collaborator

@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

import Cell from './Cell';
import helpers, { Row } from './test/GridPropHelpers';
import { SimpleCellFormatter } from './formatters';
import { ValueFormatter } from './formatters';
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

editorProps: SharedEditorProps<TRow>;
}

export interface SelectedCellProps extends SelectedCellPropsBase {
Copy link
Collaborator

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.

2 participants