Skip to content

Commit 57f7634

Browse files
committed
Fix display name on helper components.
1 parent c000156 commit 57f7634

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
},
1313
"plugins": ["jest", "promise", "react"],
1414
"rules": {
15-
"react/display-name": "off",
1615
"react/prop-types": "off"
1716
},
1817
"settings": {

examples/basic-fetch/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SKIP_PREFLIGHT_CHECK=true

examples/custom-instance/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SKIP_PREFLIGHT_CHECK=true

src/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const createInstance = (defaultProps = {}) => {
138138
* @prop {boolean} persist Show until we have data, even while loading or when an error occurred
139139
* @prop {Function|Node} children Function (passing state) or React node
140140
*/
141-
Async.Pending = ({ children, persist }) => (
141+
const Pending = ({ children, persist }) => (
142142
<Consumer>
143143
{state => {
144144
if (state.data !== undefined) return null
@@ -155,7 +155,7 @@ export const createInstance = (defaultProps = {}) => {
155155
* @prop {boolean} initial Show only on initial load (data is undefined)
156156
* @prop {Function|Node} children Function (passing state) or React node
157157
*/
158-
Async.Loading = ({ children, initial }) => (
158+
const Loading = ({ children, initial }) => (
159159
<Consumer>
160160
{state => {
161161
if (!state.isLoading) return null
@@ -171,7 +171,7 @@ export const createInstance = (defaultProps = {}) => {
171171
* @prop {boolean} persist Show old data while loading
172172
* @prop {Function|Node} children Function (passing data and state) or React node
173173
*/
174-
Async.Resolved = ({ children, persist }) => (
174+
const Resolved = ({ children, persist }) => (
175175
<Consumer>
176176
{state => {
177177
if (state.data === undefined) return null
@@ -188,7 +188,7 @@ export const createInstance = (defaultProps = {}) => {
188188
* @prop {boolean} persist Show old error while loading
189189
* @prop {Function|Node} children Function (passing error and state) or React node
190190
*/
191-
Async.Rejected = ({ children, persist }) => (
191+
const Rejected = ({ children, persist }) => (
192192
<Consumer>
193193
{state => {
194194
if (state.error === undefined) return null
@@ -198,6 +198,11 @@ export const createInstance = (defaultProps = {}) => {
198198
</Consumer>
199199
)
200200

201+
Async.Pending = Pending
202+
Async.Loading = Loading
203+
Async.Resolved = Resolved
204+
Async.Rejected = Rejected
205+
201206
return Async
202207
}
203208

0 commit comments

Comments
 (0)