docs(react): update component usage docs (#17615)

This commit is contained in:
Josh Thomas
2019-02-26 08:54:01 -06:00
committed by GitHub
parent f44c17e03b
commit 22d1aeebaa
113 changed files with 7207 additions and 0 deletions

View File

@ -93,6 +93,55 @@ async function presentLoadingWithOptions() {
```
### React
```tsx
import React, { Component } from 'react'
import { IonLoading } from '@ionic/react';
type Props = {}
type State = {
showLoading1: boolean
showLoading2: boolean
}
export class LoadingExample extends Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
showLoading1: false
showLoading2: false
};
}
render() {
return (
<IonLoading
isOpen={this.state.showLoading1}
onDidDismiss={() => this.setState(() => ({ showLoading1: false }))}
message={'Hellooo'}
duration={200}
>
</IonLoading>
<IonLoading
isOpen={this.state.showLoading2}
onDidDismiss={() => this.setState(() => ({ showLoading2: false }))}
spinner={null}
duration={5000}
message='Please wait...'}
translucent={true}
cssClass='custom-class custom-loading'
>
</IonLoading>
);
}
}
```
## Properties

View File

@ -0,0 +1,45 @@
```tsx
import React, { Component } from 'react'
import { IonLoading } from '@ionic/react';
type Props = {}
type State = {
showLoading1: boolean
showLoading2: boolean
}
export class LoadingExample extends Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
showLoading1: false
showLoading2: false
};
}
render() {
return (
<IonLoading
isOpen={this.state.showLoading1}
onDidDismiss={() => this.setState(() => ({ showLoading1: false }))}
message={'Hellooo'}
duration={200}
>
</IonLoading>
<IonLoading
isOpen={this.state.showLoading2}
onDidDismiss={() => this.setState(() => ({ showLoading2: false }))}
spinner={null}
duration={5000}
message='Please wait...'}
translucent={true}
cssClass='custom-class custom-loading'
>
</IonLoading>
);
}
}
```