File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
3+ import { Box } from '../Layout' ;
4+
5+ export interface FormProps {
6+ children : React . ReactNode ;
7+ onSubmit : ( ) => void ;
8+ }
9+
10+ // In React Native there is no corresponding <form> tag
11+ const Form = ( { children } : FormProps ) => < Box > { children } </ Box > ;
12+
13+ export default Form ;
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
3+ import { FormProps } from './Form' ;
4+
5+ // On the web <form> enables native behavior such as `Enter` to submit
6+ const Form = ( { children, onSubmit } : FormProps ) => (
7+ < form onSubmit = { onSubmit } > { children } </ form >
8+ ) ;
9+
10+ export default Form ;
File renamed without changes.
Original file line number Diff line number Diff line change 11export { default as FormField , FormFieldProps } from './FormField' ;
2+ export { default as Form , FormProps } from './Form' ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as React from 'react';
22import { PickerProps } from 'react-native' ;
33
44import { withTheme } from '../../theme' ;
5- import { FormField , FormFieldProps } from '../FormField ' ;
5+ import { FormField , FormFieldProps } from '../Form ' ;
66import Picker from './Picker' ;
77
88export interface PickerFieldProps extends FormFieldProps , PickerProps { }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22
33import { withTheme } from '../../theme' ;
4- import { FormField , FormFieldProps } from '../FormField ' ;
4+ import { FormField , FormFieldProps } from '../Form ' ;
55import SelectList , { SelectListProps } from './SelectList' ;
66
77export interface SelectListFieldProps extends FormFieldProps , SelectListProps { }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22
33import { withTheme } from '../../theme' ;
4- import { FormField , FormFieldProps } from '../FormField ' ;
4+ import { FormField , FormFieldProps } from '../Form ' ;
55import TextArea , { TextAreaProps } from './TextArea' ;
66
77export interface TextAreaFieldProps extends FormFieldProps , TextAreaProps { }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22
33import { withTheme } from '../../theme' ;
4- import { FormField , FormFieldProps } from '../FormField ' ;
4+ import { FormField , FormFieldProps } from '../Form ' ;
55import TextInput , { TextInputProps } from './TextInput' ;
66
77export interface TextInputFieldProps extends FormFieldProps , TextInputProps { }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export * from './Counter';
77export * from './Dialog' ;
88export * from './Divider' ;
99export * from './Helpers' ;
10- export * from './FormField ' ;
10+ export * from './Form ' ;
1111export * from './Layout' ;
1212export * from './Loading' ;
1313export * from './Modal' ;
You can’t perform that action at this time.
0 commit comments