상세 컨텐츠

본문 제목

Import Style CSS

React

by 일단두잇 2023. 1. 20. 16:43

본문

반응형

 

 

예전부터 사용하던 CSS 나 SCSS와 같이 Style을 정의해서 사용합니다.

 

파일 구성

 

SamplePage.jsx

import './style/SamplePage.css';

const SamplePage = () => {
  return (
    <>
      <div className="titleWrap">
        <button className="arrowBack" onClick={() => {}} />
        <label style={{ marginLeft: '25px' }}>제목</label>
      </div>
    </>
  );
};
export default SamplePage;
 

 

장점

- 기존 퍼블리셔와 역할은 분리할 수 있다.

- Style CSS로 파싱하는 작업이 없기 때문에 React Style 보다 속도가 빠르다.

 

반응형

'React' 카테고리의 다른 글

React Path alias 절대경로 설정  (0) 2023.01.20
React Rendering이 두번씩 실행되는 경우  (0) 2023.01.20
CSS in JS : styled-components  (0) 2023.01.20
Inline Style CSS  (0) 2023.01.20
React Style 적용 방법  (0) 2023.01.20

관련글 더보기

댓글 영역