Skip to content

Commit

Permalink
fix params example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
restuwahyu13 committed Nov 19, 2020
1 parent 9eb1c9f commit 35234e6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ npm i react-fakers | yarn add react-fakers
const [state, setState] = useState(false)
const { success, error } = useJsonPlaceHolder({
type: 'posts',
params: {
userId: 1
},
params: { posts: { userId: 1 } },
options: { limit: 3 }
})

Expand Down Expand Up @@ -276,10 +274,11 @@ npm i react-fakers | yarn add react-fakers
return (
<>
<Faker
success={this.onSuccess}
error={this.onError}
type='addresses'
params: { addresses: { quantity: 5 } }/>
success={this.onSuccess}
error={this.onError}
type='addresses'
params={{ addresses: { quantity: 5 } }}
/>

{!this.state.loading && <h4>Loading....</h4>}
{this.state.loading &&
Expand All @@ -302,7 +301,7 @@ npm i react-fakers | yarn add react-fakers

```js
import React, { Component } from 'react'
import { Faker } from 'react-fakers'
import { JsonPlaceHolder } from 'react-fakers'

class App extends Component {
constructor(props) {
Expand Down Expand Up @@ -352,7 +351,7 @@ npm i react-fakers | yarn add react-fakers

```js
import React, { Component } from 'react'
import { Faker } from 'react-fakers'
import { JsonPlaceHolder } from 'react-fakers'

class App extends Component {
constructor(props) {
Expand Down Expand Up @@ -383,7 +382,7 @@ npm i react-fakers | yarn add react-fakers
success={this.onSuccess}
error={this.onError}
type='posts'
params={{ userId: 1 }}
params = {{ posts: { userId: 1 } }},
options={{ limit: 3 }}
/>

Expand Down

0 comments on commit 35234e6

Please sign in to comment.