Remove JSX from src/

This commit is contained in:
Gustav Hansen 2018-03-21 09:43:09 -04:00
parent 5b7912679c
commit cf1c9c2d3c
7 changed files with 120 additions and 67 deletions

View file

@ -7,10 +7,10 @@ class Box extends Component {
const { vertical, children, ...otherProps } = this.props;
if (vertical) {
return <VerticalBox {...otherProps}>{children}</VerticalBox>;
return React.createElement(VerticalBox, otherProps, children);
}
return <HorizontalBox {...otherProps}>{children}</HorizontalBox>;
return React.createElement(HorizontalBox, otherProps, children);
}
}

View file

@ -5,14 +5,14 @@ import { MenuBar, MenuBarItem } from '../';
class Menu extends Component {
render() {
const { children, ...otherProps } = this.props;
return <MenuBar {...otherProps}>{children}</MenuBar>;
return React.createElement(MenuBar, otherProps, children);
}
}
Menu.Item = class Item extends Component {
render() {
const { children, ...otherProps } = this.props;
return <MenuBarItem {...otherProps}>{children}</MenuBarItem>;
return React.createElement(MenuBarItem, otherProps, children);
}
};

View file

@ -6,17 +6,17 @@ class Picker extends Component {
render() {
const { editable, children, ...otherProps } = this.props;
if (editable) {
return <EditableCombobox {...otherProps}>{children}</EditableCombobox>;
return React.createElement(EditableCombobox, otherProps, children);
}
return <Combobox {...otherProps}>{children}</Combobox>;
return React.createElement(Combobox, otherProps, children);
}
}
Picker.Item = class Item extends Component {
render() {
const { children } = this.props;
return <ComboboxItem>{children}</ComboboxItem>;
return React.createElement(ComboboxItem, null, children);
}
};

View file

@ -5,14 +5,14 @@ import { RadioButton, RadioButtonItem } from '../';
class RadioButtons extends Component {
render() {
const { children, ...otherProps } = this.props;
return <RadioButton {...otherProps}>{children}</RadioButton>;
return React.createElement(RadioButton, otherProps, children);
}
}
RadioButtons.Item = class Item extends Component {
render() {
const { children } = this.props;
return <RadioButtonItem>{children}</RadioButtonItem>;
return React.createElement(RadioButtonItem, null, children);
}
};

View file

@ -6,10 +6,10 @@ class Separator extends Component {
render() {
const { vertical, children, ...otherProps } = this.props;
if (vertical) {
return <VerticalSeparator {...otherProps} />;
return React.createElement(VerticalSeparator, otherProps);
}
return <HorizontalSeparator {...otherProps} />;
return React.createElement(HorizontalSeparator, otherProps);
}
}

View file

@ -7,14 +7,14 @@ class TextInput extends Component {
const { secure, multiline, children, ...otherProps } = this.props;
if (secure) {
return <PasswordEntry {...otherProps}>{children}</PasswordEntry>;
return React.createElement(PasswordEntry, otherProps, children);
}
if (multiline) {
return <MultilineEntry {...otherProps}>{children}</MultilineEntry>;
return React.createElement(MultilineEntry, otherProps, children);
}
return <Entry {...otherProps}>{children}</Entry>;
return React.createElement(Entry, otherProps, children);
}
}