Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
style: undefined,
};
if (props.style && props.style.flex) {
// Flex is a style that needs to be lifted from the inner component to the outer
// component to ensure proper layout.
outerProps.style = { flex: props.style.flex };
}
return React.createElement(
TouchableWithoutFeedback,
outerProps,
React.createElement(
View,
props,
...Render.renderChildren(element, stylesheets, onUpdate, newOptions),
),
);
}
}
export function text(element, stylesheets, onUpdate, options) {
const { skipHref } = options || {};
const props = createProps(element, stylesheets, options);
const component = React.createElement(
Text,
props,
...Render.renderChildren(element, stylesheets, onUpdate, options),
);
return skipHref ?
component :
addHref(component, element, stylesheets, onUpdate, options);
}
const registerInputHandler = ref => {
inputRefs.push(ref);
};
viewOptions = { ...viewOptions, registerInputHandler };
}
const scrollDirection = element.getAttribute('scroll-orientation');
if (scrollDirection === 'horizontal') {
props.horizontal = true;
}
}
const component = React.createElement(
Component,
props,
...Render.renderChildren(element, stylesheets, onUpdate, viewOptions),
);
return skipHref
? component
: addHref(component, element, stylesheets, onUpdate, viewOptions);
}
}
) => {
const href = element.getAttribute('href');
const action = element.getAttribute('action');
const childNodes = element.childNodes ? Array.from(element.childNodes) : [];
const behaviorElements = childNodes.filter(
n => n && n.nodeType === 1 && n.tagName === 'behavior',
);
const hasBehaviors = href || action || behaviorElements.length > 0;
if (!hasBehaviors) {
return component;
}
return React.createElement(
HyperRef,
{ element, stylesheets, onUpdate, options },
...Render.renderChildren(element, stylesheets, onUpdate, options),
);
};
render() {
const { element, stylesheets, onUpdate, options } = this.props;
if (element.getAttribute('hide') === 'true') {
return null;
}
const props = createProps(element, stylesheets, { ...options });
return React.createElement(
View,
props,
...Render.renderChildren(element, stylesheets, onUpdate, {
...options,
onToggle: this.onToggle,
}),
);
}
}
const registerInputHandler = ref => inputRefs.push(ref);
viewOptions = { ...viewOptions, registerInputHandler };
}
}
if (scrollable) {
const scrollDirection = element.getAttribute('scroll-orientation');
if (scrollDirection === 'horizontal') {
props.horizontal = true;
}
}
const component = React.createElement(
c,
props,
...Render.renderChildren(element, stylesheets, onUpdate, viewOptions),
);
return skipHref ?
component :
addHref(component, element, stylesheets, onUpdate, viewOptions);
}
render() {
const { element, stylesheets, onUpdate, options } = this.props;
return React.createElement(
EventSourceContext.Provider,
{ value: this.eventObject },
...Render.renderChildren(element, stylesheets, onUpdate, options),
);
}
}
render() {
const { element, stylesheets, onUpdate, options } = this.props;
if (element.getAttribute('hide') === 'true') {
return null;
}
const props = createProps(element, stylesheets, { ...options });
return React.createElement(
View,
props,
...Render.renderChildren(element, stylesheets, onUpdate, {
...options,
onSelect: this.onSelect,
}),
);
}
}