Browse Source

🚑 hotfix: support InspectorWrapper

pull/7735/head
chenshuai2144 5 years ago
parent
commit
9862c9430f
  1. 6
      config/routes.ts
  2. 7
      src/layouts/BlankLayout.tsx

6
config/routes.ts

@ -1,4 +1,8 @@
export default [
{
path: '/',
component: '../layouts/BlankLayout',
routes: [
{
path: '/user',
component: '../layouts/UserLayout',
@ -61,6 +65,8 @@
},
],
},
],
},
{
component: './404',
},

7
src/layouts/BlankLayout.tsx

@ -1,5 +1,10 @@
import React from 'react';
import { Inspector } from 'react-dev-inspector';
const Layout: React.FC = ({ children }) => <>{children}</>;
const InspectorWrapper = process.env.NODE_ENV === 'development' ? Inspector : React.Fragment;
const Layout: React.FC = ({ children }) => {
return <InspectorWrapper>{children}</InspectorWrapper>;
};
export default Layout;

Loading…
Cancel
Save