From 30e6f65ceb0f99f8825ddd598b4df0b9e251111f Mon Sep 17 00:00:00 2001 From: Avi Mishra Date: Sat, 12 Mar 2022 15:59:17 +0530 Subject: [PATCH 1/2] Fixed import/no-anonymous-default-export warning --- docs/react/external_data.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/react/external_data.md b/docs/react/external_data.md index e460e6709..3ac0311fe 100644 --- a/docs/react/external_data.md +++ b/docs/react/external_data.md @@ -82,7 +82,7 @@ We will create a file at {file}`middleware/api.js` and the implementation will l ```{code-block} jsx :linenos: -export default store => next => action => { +const api = store => next => action => { const { request, type, ...rest } = action; if (!request) { @@ -102,6 +102,8 @@ export default store => next => action => { return actionPromise; }; + +export default api; ``` Finally we need to apply our middleware to the store in `App.js`: From 9846fd94ae59f961bb26bf7b5d65df8b6f544c22 Mon Sep 17 00:00:00 2001 From: Avi Mishra Date: Sat, 12 Mar 2022 16:00:54 +0530 Subject: [PATCH 2/2] Fixed testing-library/render-result-naming-convention --- docs/react/snapshot_testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/react/snapshot_testing.md b/docs/react/snapshot_testing.md index 4d9e94fc1..980ea533e 100644 --- a/docs/react/snapshot_testing.md +++ b/docs/react/snapshot_testing.md @@ -26,13 +26,13 @@ import FaqItem from "./FaqItem"; describe("FaqItem", () => { it("renders a FAQ item", () => { - const component = render( + const view = render( ); - expect(component).toMatchSnapshot(); + expect(view).toMatchSnapshot(); }); }); ```