优化
This commit is contained in:
11
client/shared/components/DevContainer.tsx
Normal file
11
client/shared/components/DevContainer.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import React, { Fragment, PropsWithChildren } from 'react';
|
||||
import { isDevelopment } from '../utils/environment';
|
||||
|
||||
/**
|
||||
* 开发中容器
|
||||
* 在容器下的组件在生产环境下不会被渲染
|
||||
*/
|
||||
export const DevContainer: React.FC<PropsWithChildren> = React.memo((props) => {
|
||||
return isDevelopment ? <Fragment>{props.children}</Fragment> : null;
|
||||
});
|
||||
DevContainer.displayName = 'DevContainer';
|
||||
Reference in New Issue
Block a user