Skip to content

Commit

Permalink
feat: remove useless warn
Browse files Browse the repository at this point in the history
  • Loading branch information
IVLIU committed Oct 28, 2024
1 parent ed191f9 commit 9f52145
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Repeater.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import React, { useRef, useEffect } from "react";
import { canUseDOM } from "./canUseDOM";
import type { FC } from "react";
import type { IProps } from "./type";

const isBrowser = canUseDOM();

export const Repeater: FC<IProps> = (props) => {
// props
const { mode, children } = props;
Expand Down Expand Up @@ -42,22 +39,6 @@ export const Repeater: FC<IProps> = (props) => {
}
}

// warning
// ? throw a new promise is pending
if (isBrowser && mode === "hidden") {
console.error(
navigator.language === "zh-CN"
? `
由于react的限制,由startTransition或者useDeferredValue触发的更新引起的组件挂起不会渲染回退,具体可以参考
https://zh-hans.react.dev/reference/react/Suspense#preventing-already-revealed-content-from-hiding
`
: `
Due to the limitations of react, component suspension caused by updates triggered by startTransition or useDeferredValue will not render the rollback. For details, please refer to
https://react.dev/reference/react/Suspense#preventing-already-revealed-content-from-hiding
`,
);
}

resolvePromise();

return <>{typeof children === 'function' ? children(mode) : children}</>;
Expand Down

0 comments on commit 9f52145

Please sign in to comment.