Skip to content

kristerkari/react-native-svg-example

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Bumps [metro-react-native-babel-preset](https://github.com/facebook/metro) from 0.76.5 to 0.77.0.
- [Release notes](https://github.com/facebook/metro/releases)
- [Changelog](https://github.com/facebook/metro/blob/main/CHANGELOG.md)
- [Commits](facebook/metro@v0.76.5...v0.77.0)

---
updated-dependencies:
- dependency-name: metro-react-native-babel-preset
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c6de371

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
ios
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

React Native SVG demo

Platform - Android, iOS and Web contributions welcome

A simple example app that shows how you can use SVG files in React Native.

The SVG images used in this app can be found from the logos folder.

How does it work?

The .svg files can be imported inside a React component:

import Logo from './logo.svg';

The images can then be used as a component:

<Logo width={120} height={40} />

Try it

Step 1: Install depencies to run React Native

Make sure that you have react-native-cli installed (npm install -g react-native-cli) and XCode (for iOS development) / Android Studio (for Android development) installed and working.

Step 2: Clone the repo and move to project

git clone git@github.com:kristerkari/react-native-svg-example.git
cd react-native-svg-example

Step 3: Install example app's dependencies

npm install

Step 4: Run React Native packager

You can open a new terminal tab to run React Native's packager.

npm start

Step 5: Run app on Android or iOS

First make sure that your Android emulator or iOS simulator is working, then:

npm run ios

or

npm run android

or

npm run web

Screenshots

iOS - Android - Web