Skip to content

Commit e4356a1

Browse files
Renames widgets to components
1 parent 9947e8e commit e4356a1

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ import { AppRegistry } from 'react-native'
141141
AppRegistry.registerComponent('Form', () => Form)
142142
```
143143

144-
#### Create your own widget to keep it DRY
144+
#### Create your own component to keep it DRY
145145

146146
```js
147147
import React, { Component, PropTypes } from 'react-native'
148148
import Icon from 'react-native-vector-icons/MaterialIcons'
149149
import { StatelessForm, InlineTextInput } from 'react-native-stateless-form'
150150

151151
class FormInput extends Component {
152-
// You MUST implement focus and blur methods for your widget to work
152+
// You MUST implement focus and blur methods for your component to work
153153
focus() {
154154
this.refs.input.focus()
155155
}
@@ -513,15 +513,15 @@ AppRegistry.registerComponent('Form', () => Root)
513513

514514
## StatelessForm
515515

516-
A wrapper that will manage auto-focusing and auto-scrolling for its children widgets
516+
A wrapper that will manage auto-focusing and auto-scrolling for its children components
517517

518518
| Property | Type | Default | Description |
519519
|---------------|----------|--------------|----------------------------------------------------------------|
520520
| style | style | {} | Style for the form wrapper |
521521

522522
\+ Any other [ScrollView](https://facebook.github.io/react-native/docs/scrollview.html#content) prop you wish to pass.
523523

524-
## Widgets
524+
## Components
525525

526526
#### InlineTextInput
527527

@@ -542,33 +542,33 @@ A wrapper that will manage auto-focusing and auto-scrolling for its children wid
542542

543543
\+ Any other [TextInput](https://facebook.github.io/react-native/docs/textinput.html#content) prop you wish to pass.
544544

545-
#### Other widgets
545+
#### Other components
546546

547-
My intention is to implement most of [FaridSafi/react-native-gifted-form](https://github.com/FaridSafi/react-native-gifted-form)'s widgets. But I'll do each one only when I need it in a real project, so it might take some time.
547+
My intention is to implement most of [FaridSafi/react-native-gifted-form](https://github.com/FaridSafi/react-native-gifted-form)'s components. But I'll do each one only when I need it in a real project, so it might take some time.
548548

549549
PR's are very much welcome!
550550

551-
## Creating new widgets
551+
## Creating new components
552552

553-
Any react component can be rendered inside Stateless Form as a widget. But there is a special case below:
553+
Any react component can be rendered inside Stateless Form as a component. But there is a special case below:
554554

555-
#### Focusable input widgets
555+
#### Focusable input components
556556

557-
If you want your widget to receive focus when previous widget finished editing, you must implement the following pattern:
557+
If you want your component to receive focus when previous component finished editing, you must implement the following pattern:
558558

559-
- Your widget should implement the `focus()` method.
560-
- Your widget should implement the `blur()` method.
561-
- Your widget should implement `onSubmitEditing` or equivalent and call `this.props.onNextInputFocus(this.props.nextInput, this)` so StatelessForm can focus the next input or blur the current input.
562-
- Your widget must have `valid` and `value` on its `propTypes`. This is how `StatelessForm` will recognize it as a focusable and/or scrollable input widget. It is important that only focusable or scrollable widgets have these props on `propTypes`.
559+
- Your component should implement the `focus()` method.
560+
- Your component should implement the `blur()` method.
561+
- Your component should implement `onSubmitEditing` or equivalent and call `this.props.onNextInputFocus(this.props.nextInput, this)` so StatelessForm can focus the next input or blur the current input.
562+
- Your component must have `valid` and `value` on its `propTypes`. This is how `StatelessForm` will recognize it as a focusable and/or scrollable input component. It is important that only focusable or scrollable components have these props on `propTypes`.
563563

564-
#### Scrollable input widgets
564+
#### Scrollable input components
565565

566-
If you want your widget to receive scroll when showing keyboard, you must implement the following pattern:
566+
If you want your component to receive scroll when showing keyboard, you must implement the following pattern:
567567

568-
- Your widget should implement `onFocus` and call `this.props.onFocus(scrollTo)` on focus. `scrollTo` must be your widget's `y` position.
569-
- You can get your `y` position using `onLayout` prop. Check [InlineTextInput](https://github.com/danielweinmann/react-native-stateless-form/blob/master/widgets/InlineTextInput.js) for references on how to implement it.
570-
- Your widget should implement `onBlur` and call `this.props.onBlur` on blur.
571-
- Your widget also must have `valid` and `value` on its `propTypes`.
568+
- Your component should implement `onFocus` and call `this.props.onFocus(scrollTo)` on focus. `scrollTo` must be your component's `y` position.
569+
- You can get your `y` position using `onLayout` prop. Check [InlineTextInput](https://github.com/danielweinmann/react-native-stateless-form/blob/master/components/InlineTextInput.js) for references on how to implement it.
570+
- Your component should implement `onBlur` and call `this.props.onBlur` on blur.
571+
- Your component also must have `valid` and `value` on its `propTypes`.
572572

573573
## Contributing
574574

File renamed without changes.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import StatelessForm from './StatelessForm'
2-
import InlineTextInput from './widgets/InlineTextInput'
2+
import InlineTextInput from './components/InlineTextInput'
33

44
module.exports = { StatelessForm, InlineTextInput }

0 commit comments

Comments
 (0)