mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-27 00:06:55 +00:00
Update formatter and linter tools
This commit is contained in:
@@ -36,9 +36,9 @@ export function getApplication(RootComponent: ReactClass<Object>, initialProps:
|
||||
<RootComponent {...initialProps} />
|
||||
</AppContainer>
|
||||
);
|
||||
const stylesheets = StyleSheet.getStyleSheets().map(sheet =>
|
||||
const stylesheets = StyleSheet.getStyleSheets().map(sheet => (
|
||||
// ensure that CSS text is not escaped
|
||||
<style dangerouslySetInnerHTML={{ __html: sheet.textContent }} id={sheet.id} />
|
||||
);
|
||||
));
|
||||
return { element, stylesheets };
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ const createDeclarationString = (prop, val) => {
|
||||
* // => 'color:blue;width:20px'
|
||||
*/
|
||||
const generateCss = style =>
|
||||
mapKeyValue(prefixStyles(style), createDeclarationString).sort().join(';');
|
||||
mapKeyValue(prefixStyles(style), createDeclarationString)
|
||||
.sort()
|
||||
.join(';');
|
||||
|
||||
export default generateCss;
|
||||
|
||||
@@ -43,9 +43,7 @@ class Button extends Component {
|
||||
]}
|
||||
testID={testID}
|
||||
>
|
||||
<Text style={[styles.text, disabled && styles.textDisabled]}>
|
||||
{title}
|
||||
</Text>
|
||||
<Text style={[styles.text, disabled && styles.textDisabled]}>{title}</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -119,12 +119,22 @@ describe('components/Image', () => {
|
||||
// initial render
|
||||
const component = mount(<Image source={{ uri: uriOne }} />);
|
||||
ImageUriCache.remove(uriOne);
|
||||
expect(component.render().find('img').attr('src')).toBe(uriOne);
|
||||
expect(
|
||||
component
|
||||
.render()
|
||||
.find('img')
|
||||
.attr('src')
|
||||
).toBe(uriOne);
|
||||
|
||||
// props update
|
||||
component.setProps({ source: { uri: uriTwo } });
|
||||
ImageUriCache.remove(uriTwo);
|
||||
expect(component.render().find('img').attr('src')).toBe(uriTwo);
|
||||
expect(
|
||||
component
|
||||
.render()
|
||||
.find('img')
|
||||
.attr('src')
|
||||
).toBe(uriTwo);
|
||||
});
|
||||
|
||||
test('is set immediately when rendered on the server', () => {
|
||||
|
||||
@@ -339,7 +339,9 @@ class TextInput extends Component {
|
||||
if (e.shiftKey) {
|
||||
keyValue = String.fromCharCode(e.which).trim();
|
||||
} else {
|
||||
keyValue = String.fromCharCode(e.which).toLowerCase().trim();
|
||||
keyValue = String.fromCharCode(e.which)
|
||||
.toLowerCase()
|
||||
.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,7 @@ class UnimplementedView extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={[unimplementedViewStyles, this.props.style]}>
|
||||
{this.props.children}
|
||||
</View>
|
||||
);
|
||||
return <View style={[unimplementedViewStyles, this.props.style]}>{this.props.children}</View>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,7 @@ describe('components/View', () => {
|
||||
|
||||
test('prop "children"', () => {
|
||||
const children = <View testID="1" />;
|
||||
const component = shallow(
|
||||
<View>
|
||||
{children}
|
||||
</View>
|
||||
);
|
||||
const component = shallow(<View>{children}</View>);
|
||||
expect(component.contains(children)).toEqual(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user