Skip to content

Commit

Permalink
refactor: import React -> tree shaking
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhokim98 committed Oct 23, 2024
1 parent bd5b111 commit 72bbf3d
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @jsxImportSource @emotion/react */
import type {Meta, StoryObj} from '@storybook/react';

import Button from './Button';
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Design/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsxImportSource @emotion/react */

import React, {forwardRef} from 'react';
import {forwardRef} from 'react';

import {useTheme} from '@theme/HDesignProvider';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Meta, StoryObj} from '@storybook/react';

import React, {useEffect, useState} from 'react';
import {useState} from 'react';

import Input from '@HDcomponents/Input/Input';
import Flex from '@HDcomponents/Flex/Flex';
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Design/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsxImportSource @emotion/react */
import React, {forwardRef, useEffect, useImperativeHandle, useRef, useState} from 'react';
import {forwardRef, useEffect, useImperativeHandle, useRef, useState} from 'react';

import IconButton from '@HDcomponents/IconButton/IconButton';
import {InputProps} from '@HDcomponents/Input/Input.type';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsxImportSource @emotion/react */
import React, {forwardRef} from 'react';
import {forwardRef} from 'react';

import Text from '@HDcomponents/Text/Text';
import IconButton from '@HDcomponents/IconButton/IconButton';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/** @jsxImportSource @emotion/react */
import type {Meta, StoryObj} from '@storybook/react';

import React from 'react';

import Tabs from '@HDcomponents/Tabs/Tabs';

import Tab from './Tab';
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Design/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsxImportSource @emotion/react */
import React, {useEffect, useRef, useState} from 'react';
import {useEffect, useRef, useState} from 'react';

import {useTheme} from '@theme/HDesignProvider';

Expand Down
2 changes: 0 additions & 2 deletions client/src/components/Design/components/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/** @jsxImportSource @emotion/react */
import type {TextProps} from '@HDcomponents/Text/Text.type';

import React from 'react';

import {useTheme} from '@theme/HDesignProvider';

import {getSizeStyling} from './Text.style';
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Design/components/Top/Top.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsxImportSource @emotion/react */
import {css} from '@emotion/react';
import React from 'react';
import {Children, isValidElement} from 'react';

import Line from './Line';
import EditableLine from './EditableLine';
Expand All @@ -10,8 +10,8 @@ Top.EditableLine = EditableLine;

export default function Top({children}: React.PropsWithChildren) {
const childrenTexts: string[] = [];
React.Children.forEach(children, child => {
if (React.isValidElement(child) && child.type === Top.Line) {
Children.forEach(children, child => {
if (isValidElement(child) && child.type === Top.Line) {
childrenTexts.push(child.props.text);
}
});
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Design/theme/HDesignProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {createContext, useContext, useState, ReactNode} from 'react';
import {createContext, useContext, useState, ReactNode} from 'react';
import {Global} from '@emotion/react';

import {Theme} from '@theme/theme.type';
Expand Down
10 changes: 5 additions & 5 deletions client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import {StrictMode} from 'react';
import {createRoot} from 'react-dom/client';
import {RouterProvider} from 'react-router-dom';
import * as Sentry from '@sentry/react';

Expand All @@ -24,9 +24,9 @@ Sentry.init({
// }

// enableMocking().then(() => {
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
createRoot(document.getElementById('root')!).render(
<StrictMode>
<RouterProvider router={router} />
</React.StrictMode>,
</StrictMode>,
);
// });

0 comments on commit 72bbf3d

Please sign in to comment.