react-native-svg

(★ 8,000)

React Native, React Native Web, 그리고 일반 React 웹 프로젝트를 위한 SVG 라이브러리입니다.

파일 탐색기

  • .clang-format
  • .eslintignore
  • .eslintrc.js
  • .git-blame-ignore-revs
  • .gitattributes
  • .gitignore
  • .npmignore
  • .prettierrc.js
  • babel.config.js
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • jest.config.ts
  • LICENSE
  • package.json
  • react-native.config.js
  • README.md
  • rnrepo.config.json
  • RNSVG.podspec
  • tsconfig.build.json
  • tsconfig.json
  • USAGE.md
  • yarn.lock

# 설치 가이드

node
사전 준비물

설치 및 실행 절차

npm install react-native-svg

프로젝트에 react-native-svg 패키지를 설치합니다.

cd ios && pod install

iOS 네이티브 의존성을 설치합니다.

npx react-native run-ios

iOS 플랫폼에서 프로젝트를 빌드하고 실행합니다.

npx react-native run-android

Android 플랫폼에서 프로젝트를 빌드하고 실행합니다.

핵심 명령어

npm install react-native-svg

npm을 사용하여 라이브러리를 설치합니다.

yarn add react-native-svg

yarn을 사용하여 라이브러리를 설치합니다.

npx expo install react-native-svg

Expo 환경에서 호환되는 버전을 설치합니다.

cd ios && pod install

iOS CocoaPods 의존성을 설치합니다.

iOS 빌드를 위해서는 Mac 환경과 Xcode가 필요하며, Android 빌드를 위해서는 Android Studio 및 관련 SDK가 필요합니다.

# CDN으로 사용하기

jsDelivr

jsDelivr는 공개 GitHub 리포지토리를 별도 설정 없이 CDN으로 즉시 서빙합니다. 버전과 파일을 고르면 웹페이지에 바로 붙일 수 있는 링크와 예시 코드가 만들어집니다.

명령어 용어집

이 문서에서 사용된 명령어를 모아봤습니다. 낯선 명령어가 있다면 펼쳐서 확인해보세요.

🔍

npm install

설명 보기 ▼

Install Node packages.

npm {{[i|install]}}

Install dependencies listed in `package.json`:

npm {{[i|install]}} {{package_name}}@{{version}}

Download a specific version of a package and add it to the list of dependencies in `package.json`:

npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}

Download the latest version of a package and add it to the list of dev dependencies in `package.json`:

🔍

npx

설명 보기 ▼

이 명령은 `npm exec`의 별칭입니다.

tldr npm exec

자세한 내용은 원본 명령을 참고하세요:

🔍

react-native

설명 보기 ▼

React를 사용하여 네이티브 앱을 구축하기 위한 프레임워크.
더 많은 정보: <https://github.com/react-native-community/cli/blob/main/docs/commands.md>.

react-native init {{project_name}}

동일한 이름의 디렉터리에 새 React Native 프로젝트 초기화:

react-native start

메트로 번들러 시작:

react-native start --reset-cache

캐시를 초기화한 상태로 메트로 번들러 시작:

🔍

yarn

설명 보기 ▼

JavaScript 및 Node.js 패키지 대체 관리자.
더 많은 정보: <https://yarnpkg.com/cli>.

yarn global add {{module_name}}

전역적으로 모듈 설치:

yarn install

`package.json` 파일에 참조된 모든 의존성을 설치 ( `install`은 선택 사항입니다):

yarn add {{module_name}}@{{version}}

모듈을 설치하고 `package.json` 파일에 대한 의존성으로 저장 (개발 전용 의존성으로 추가하려면 `--dev` 추가):

// repository documentation