diff --git a/packages/react-router-dom/.size-snapshot.json b/packages/react-router-dom/.size-snapshot.json index f350e4a180..c2861f8018 100644 --- a/packages/react-router-dom/.size-snapshot.json +++ b/packages/react-router-dom/.size-snapshot.json @@ -1,26 +1,26 @@ { "esm/react-router-dom.js": { - "bundled": 7978, - "minified": 4880, - "gzipped": 1618, + "bundled": 10547, + "minified": 6376, + "gzipped": 2040, "treeshaked": { "rollup": { - "code": 1250, - "import_statements": 417 + "code": 1285, + "import_statements": 440 }, "webpack": { - "code": 3322 + "code": 3336 } } }, "umd/react-router-dom.js": { - "bundled": 159709, - "minified": 57597, - "gzipped": 16540 + "bundled": 162216, + "minified": 58840, + "gzipped": 16893 }, "umd/react-router-dom.min.js": { - "bundled": 97476, - "minified": 34651, - "gzipped": 10216 + "bundled": 99449, + "minified": 35481, + "gzipped": 10400 } } diff --git a/packages/react-router-dom/docs/api/Focus.md b/packages/react-router-dom/docs/api/Focus.md new file mode 100644 index 0000000000..c7504d5c82 --- /dev/null +++ b/packages/react-router-dom/docs/api/Focus.md @@ -0,0 +1,69 @@ +# <Focus> + +Provides a way for an application to add [focus management](https://developers.google.com/web/fundamentals/accessibility/focus/using-tabindex#managing_focus_at_the_page_level) after navigation for better accessibility. + +```jsx +import { Focus } from 'react-router-dom' + + + {ref => ( +
+ {/* ... */} +
+ )} +
+``` + +`Focus` uses a render prop to provide a `ref`. The `ref` should be passed to the element that will be focused. + +In order for `Focus` to work, the component type for the focused element needs to either be natively focusable (like an `` or a `