swiftype-demo / react-native Goto Github PK
View Code? Open in Web Editor NEWThis project forked from facebook/react-native
A framework for building native apps with React.
Home Page: http://facebook.github.io/react-native/
License: Other
This project forked from facebook/react-native
A framework for building native apps with React.
Home Page: http://facebook.github.io/react-native/
License: Other
react-native 0.44 introduced withCredentials flag in XHRs, which, if not specified in every fetch request, defaults to false
.
This change conflicts with the default behavior in native. In the iOS native SDK and the Android native SDK, when making a native HTTP request, cookies are sent by default.
We rarely have agreement between the platforms, but for the last 10 years they both agree on this security model for apps.
This greatly affects projects relying on cookies with their requests.
resizeMode
and borderRadius
for styling of the image.Image should be rounded and follow resize prop instructions('cover', 'contain', 'stretch', 'repeat', 'center').
Instead, image simply isn't rendered. If you remove borderRadius
or resizeMode
. All works as intended.
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, View, Image } from 'react-native';
export default class testImg extends Component {
render() {
return (
<View style={styles.container}>
<Image
style={styles.avatar}
source={{uri: 'https://pbs.twimg.com/profile_images/831993825635745796/HnVmB0-k.jpg'}}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
avatar: {
width: 70,
height: 70,
borderRadius: 35,
// resizeMode: Image.resizeMode.contain // uncomment to see the issue
}
});
AppRegistry.registerComponent('testImg', () => testImg);
Yes
Yes
react-native -v
: 0.46.1node -v
: 6.5.0npm -v
: 3.10.3yarn --version
(if you use Yarn):Then, specify:
The switch to any tab is smooth and without any flickering or selection falling back to previous tab.
Switching between TabBarIOS.Items is flickering and is not smooth. While selecting the new tab, It seems like first the new tab is selected, then immediately the old one and then again the new tab. This results in tab flickering when switching between the tabs. Worse case is, when the tabs render some more complex composed element. In this case, the new tab is not being selected, as the render is taking longer. Once it is rendered, we can select it but again the flickering occurs.
It looks like by the time the JS processes the received native event (tab switch) and sends an event (prop) back to Native, the tab selection falls back to the previous tab.
I have included very basic TabBar example with plain view and one text where flickering occurs. However, given the simple View is used in tabs here, switching is occasionally smooth.
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
Text,
View,
TabBarIOS,
} from 'react-native';
export default class tvTabBar extends Component {
_tabItems: Array<{ key: string }> = [
{ key: 'TAB 1' },
{ key: 'TAB 2' },
{ key: 'TAB 3' },
{ key: 'TAB 4' },
];
constructor(props) {
super(props);
this.state = { activeTab: 'TAB 1' };
}
_getTabItem = (key: string) => {
switch (key) {
case 'TAB 1':
return (
<View style={{ flex: 1, top: 140, borderColor: 'red', borderWidth: 10 }}>
<Text style={{ fontSize: 30 }}>TAB 1</Text>
</View>
);
case 'TAB 2':
return (
<View style={{ flex: 1, top: 140, borderColor: 'green', borderWidth: 20 }}>
<Text style={{ fontSize: 30 }}>TAB 2</Text>
</View>
);
case 'TAB 3':
return (
<View style={{ flex: 1, top: 140, borderColor: 'darkblue', borderWidth: 30 }}>
<Text style={{ fontSize: 30 }}>TAB 3</Text>
</View>
);
case 'TAB 4':
return (
<View style={{ flex: 1, top: 140, borderColor: 'deeppink', borderWidth: 40 }}>
<Text style={{ fontSize: 30 }}>TAB 4</Text>
</View>
);
default:
return null;
}
}
_setTab(key) {
return () => {
console.log('Selecting tab: ', key);
this.setState({ activeTab: key });
};
}
render() {
return (
<TabBarIOS>
{
this._tabItems.map((tabItem) => {
return (
<TabBarIOS.Item
key={tabItem.key}
onPress={this._setTab(tabItem.key)}
title={tabItem.key}
selected={tabItem.key === this.state.activeTab}
>
{ this._getTabItem(tabItem.key) }
</TabBarIOS.Item>
);
})
}
</TabBarIOS>
);
}
}
AppRegistry.registerComponent('tvTabBar', () => { return tvTabBar; });
link to project in gitlab: https://gitlab.com/radamich/tvTabBar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.