mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Separate Out Core Components Into Individual Parts
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
This commit is contained in:
committed by
Facebook Github Bot 3
parent
6128b7236f
commit
f2affcf24d
28
docs/Basics-Component-TextInput.md
Normal file
28
docs/Basics-Component-TextInput.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
id: basics-component-textinput
|
||||
title: TextInput
|
||||
layout: docs
|
||||
category: Basics
|
||||
permalink: docs/basics-component-textinput.html
|
||||
next: basics-component-listview
|
||||
---
|
||||
|
||||
Direct text-based user input is a foundation for many apps. Writing a post or comment on a page is a canonical example of this. [`TextInput`](/react-native/docs/textinput.html#content) is a basic component that allows the user to enter text.
|
||||
|
||||
This example creates a simple `TextInput` box with the `string` `Hello` as the placeholder when the `TextInput` is empty.
|
||||
|
||||
```JavaScript
|
||||
import React from 'react';
|
||||
import { AppRegistry, TextInput, View } from 'react-native';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<View>
|
||||
<TextInput placeholder="Hello" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
// App registration and rendering
|
||||
AppRegistry.registerComponent('MyApp', () => App);
|
||||
```
|
||||
Reference in New Issue
Block a user