From 78d0485f5bd7f9436d92563e080ec559c42425ea Mon Sep 17 00:00:00 2001 From: Drew Reese Date: Tue, 30 Jul 2024 17:40:53 -0700 Subject: [PATCH] Update README.md to add note about handler inheritance Added a note in the "Composing request handlers" section that parameter inheritance doesn't work with root array of handlers. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 26ef539..3f20479 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ type MswParameter = { } ``` +_**Note:** Handler inheritance only works when the root `handlers` is an object; arrays of handlers will not be merged._ + Suppose you have an application where almost every component needs to mock requests to `/login` and `/logout` the same way. You can set global MSW handlers in preview.js for those requests and bundle them into a property called `auth`, for example: