expo / react-native-loading-container Goto Github PK
View Code? Open in Web Editor NEWA container component that takes care of loading/catching timeouts/retrying
A container component that takes care of loading/catching timeouts/retrying
Hi,
Apparently ActivityIndicatorIOS is deprecated and ActivityIndicator should be used instead. Just wondering if there's any chance you're gonna fix that soon?
Thanks!
It's good to have. Everybody happy with loading overlay but it would be great to have styling props for it. I'll make a PR in near future.
I've been using this library with great success for simple fetch requests to external resources, but now I'm bringing Apollo / GraphQL into my codebase and I'm wondering how to properly use it with this package.
Apollo fetches data using its own HOC. You specify the query, and the data arrives at some point
const withQuery = graphql(gql`
{
nativeCurrencies {
name
symbol
}
}
`);
const enhance = compose(
withQuery,
);
export default enhance(SomeComponent);
So my logic for handing the fetch is abstracted away into Apollo's HOC, so I don't have direct control over it anymore. All I have to work with is whether or not data.loading
is true or false, which is great for DX. But I start to lose control over things like this.
Is there a way to get these two systems to work together? Perhaps, passing in my loading state directly rather than specifying the async functions?
Hi Brent, thanks for putting this together! It solves a problem I was about to tackle within my app.
I ran into this issue when loading my app from a pre-bundled file.
Xcode log shows this error:
'Warning: Failed propType: Required prop
onLoadStartAsyncwas not specified in
LoadingContainer. Check the render method of
PropertyList.'
If I load the app from the development server everything works wonderfully.
Is this a bug or a noob mistake? Can you point me on the right direction please?
Versions:
react-native-loading-container: 0.2.0
react-native: 0.15.0
Snippet:
class PropertyList extends Component {
async _loadProperties() { /* stuff */ }
async _handleResponse() { /* more stuff */ }
render() {
return (
<LoadingContainer style={styles.searchBarContainer}
onLoadStartAsync={this._loadProperties.bind(this)}
onReadyAsync={this._handleResponse.bind(this)}
>
<ListView />
</LoadingContainer>
)
}
}
Holla,
i get the above mentioned error sometimes. Any idea what to do or how to solve this?
My code:
} else {
return (
<LoadingContainer
onLoadStartAsync={this._loadInitialDataAsync.bind(this)}>
{ /* render content */ }
<View style={{flex: 1}}>
<Image style={styles.backgroundImage}
source={require('../../Images/paper_background_icon.png')}/>
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderNetworkList}
/>
<AddNetworkActionBtn
style={{flex:1}}
navigator={this.props.navigator}
{...this.props}
actualNetworks={actualNetworks}/>
</View>
</LoadingContainer>
)
}
},
async _loadInitialDataAsync() {
let response = await fetch(API_URL + 'families', {
method: 'GET',
headers: {'Authorization': AuthStore.getUserTokenWithBearer()}
});
return response.json();
},
My LoadingContainer
renders a ListView
which contains a refreshControl
prop:
<LoadingContainer
...
onLoadStartAsync={this._loadInitialDataAsync.bind(this)}
onReadyAsync={this._onReadyAsync.bind(this)}
...
>
<ListView
...
refreshControl={
<RefreshControl
...
onRefresh={() => {}} // what should I supply here?
...
/>
...
/>
</LoadingContainer>
What should I be supplying to onRefresh
to get it to play nicely with onLoadStartAsync
and onReadyAsync
? I basically just want to re-execute their logic to get my ListView's data to update, but I'm not sure how to get that to work. Example would be great!
Hello, I was planning on using your component for a project, but after testing your example I get multiple yellow warnings. These warnings are generated because React.PropTypes
is being manually called for the indeterminate
prop on ProgressBarAndroid
.
The same warning links me to https://fb.me/react-warning-dont-call-proptypes.
I tried to fix it by myself but I couldn't figure it out.
I've attached screenshots of the three warnings I get.
Hey @ide @brentvatne, I can lend a hand during the weekend if you're not already working on the update.
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.