Skip to content
This repository was archived by the owner on Aug 3, 2023. It is now read-only.

Commit a8736ed

Browse files
authored
Merge pull request #172 from jamesplease/3.0.1
3.0.1
2 parents 5eddd22 + 1a24d6a commit a8736ed

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
### v3.0.1 (2018/4/24)
4+
5+
**Bug Fixes**
6+
7+
* Fixes a bug where `isLazy` would sometimes be computed using previous
8+
props rather than the current props.
9+
310
### v3.0.0 (2018/4/24)
411

512
> Although the changes in this release are technically breaking, they are unlikely to

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-request",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Declarative HTTP requests with React.",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/fetch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export class Fetch extends React.Component {
7474

7575
// We default to being lazy for "write" requests,
7676
// such as POST, PATCH, DELETE, and so on.
77-
isLazy = props => {
78-
const { lazy, method } = props || this.props;
77+
isLazy = () => {
78+
const { lazy, method } = this.props;
7979

8080
return typeof lazy === 'undefined' ? !this.isReadRequest(method) : lazy;
8181
};
@@ -121,7 +121,7 @@ export class Fetch extends React.Component {
121121
method: prevProps.method.toUpperCase()
122122
});
123123

124-
if (currentRequestKey !== prevRequestKey && !this.isLazy(prevProps)) {
124+
if (currentRequestKey !== prevRequestKey && !this.isLazy()) {
125125
this.fetchData({
126126
requestKey: currentRequestKey
127127
});

test/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"extends": [
3+
"../.eslintrc"
4+
],
25
"env": {
36
"jest": true,
47
"node": true

0 commit comments

Comments
 (0)