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

Commit

Permalink
Merge pull request #172 from jamesplease/3.0.1
Browse files Browse the repository at this point in the history
3.0.1
  • Loading branch information
jamesplease authored Apr 25, 2018
2 parents 5eddd22 + 1a24d6a commit a8736ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### v3.0.1 (2018/4/24)

**Bug Fixes**

* Fixes a bug where `isLazy` would sometimes be computed using previous
props rather than the current props.

### v3.0.0 (2018/4/24)

> Although the changes in this release are technically breaking, they are unlikely to
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-request",
"version": "3.0.0",
"version": "3.0.1",
"description": "Declarative HTTP requests with React.",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export class Fetch extends React.Component {

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

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

if (currentRequestKey !== prevRequestKey && !this.isLazy(prevProps)) {
if (currentRequestKey !== prevRequestKey && !this.isLazy()) {
this.fetchData({
requestKey: currentRequestKey
});
Expand Down
3 changes: 3 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": [
"../.eslintrc"
],
"env": {
"jest": true,
"node": true
Expand Down

0 comments on commit a8736ed

Please sign in to comment.