mirror of
https://github.com/status-im/react-native.git
synced 2025-02-02 12:43:54 +00:00
f2affcf24d
Summary: Will create new issue to add more information to the `Components` section of the Tutorial since that was gutted by this change. Fixes #8156 Closes https://github.com/facebook/react-native/pull/8256 Differential Revision: D3459601 Pulled By: JoelMarcey fbshipit-source-id: 4038afc463bffcf8efda36d29bc7c443bbc8f4bd
31 lines
819 B
Markdown
31 lines
819 B
Markdown
---
|
|
id: basics-component-image
|
|
title: Image
|
|
layout: docs
|
|
category: Basics
|
|
permalink: docs/basics-component-image.html
|
|
next: basics-component-view
|
|
---
|
|
|
|
The other basic React Native component is the [`Image`](/react-native/docs/image.html#content) component. Like `Text`, the `Image` component simply renders an image.
|
|
|
|
> An `Image` is analogous to using `img` when building websites.
|
|
|
|
The simplest way to render an image is to provide a source file to that image via the `source` attribute.
|
|
|
|
This example displays a checkbox `Image` on the device.
|
|
|
|
```JavaScript
|
|
import React from 'react';
|
|
import { AppRegistry, Image } from 'react-native';
|
|
|
|
const App = () => {
|
|
return (
|
|
<Image source={require('./img/check.png')} />
|
|
);
|
|
}
|
|
|
|
// App registration and rendering
|
|
AppRegistry.registerComponent('MyApp', () => App);
|
|
```
|