Skip to content

Commit

Permalink
remove memo
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Mar 2, 2024
1 parent 72ea1dc commit 4f9d887
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 41 deletions.
4 changes: 1 addition & 3 deletions examples/09_reactmemo/src/TodoItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { memo } from 'react-tracked';

import { useDispatch, TodoType } from './store';

Expand All @@ -9,8 +8,7 @@ type Props = {

let numRendered = 0;

// Use custom memo instead of React.memo
const TodoItem = memo(({ todo }: Props) => {
const TodoItem = React.memo(({ todo }: Props) => {
const dispatch = useDispatch();
return (
<li>
Expand Down
6 changes: 3 additions & 3 deletions examples/15_reactmemoref/src/TodoItem.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { forwardRef } from 'react';
import { memo } from 'react-tracked';

import { useDispatch, TodoType } from './store';

type Props = {
// FIXME why this complaints?
// eslint-disable-next-line react/no-unused-prop-types
todo: TodoType;
};

let numRendered = 0;

// Use custom memo instead of React.memo
const TodoItem = memo(
const TodoItem = React.memo(
forwardRef<HTMLInputElement, Props>(({ todo }, ref) => {
const dispatch = useDispatch();
return (
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { createContainer } from './createContainer';
export { createTrackedSelector } from './createTrackedSelector';
export { memo } from './memo';
export { getUntracked as getUntrackedObject } from 'proxy-compare';
34 changes: 0 additions & 34 deletions src/memo.ts

This file was deleted.

0 comments on commit 4f9d887

Please sign in to comment.