Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export function ReactQueryDevtools(props: {
* Defaults to 'bottom-left'.
*/
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
/**
* Use this to render the devtools inside a different type of container element for a11y purposes.
* Any string which corresponds to a valid intrinsic JSX element is allowed.
* Defaults to 'footer'.
*/
containerElement?: keyof JSX.IntrinsicElements
}): React.ReactElement

export function ReactQueryDevtoolsPanel(props: {
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function ReactQueryDevtools({
closeButtonProps = {},
toggleButtonProps = {},
position = 'bottom-left',
containerElement: Container = 'footer',
}) {
const rootRef = React.useRef()
const panelRef = React.useRef()
Expand Down Expand Up @@ -94,7 +95,7 @@ export function ReactQueryDevtools({
} = toggleButtonProps

return (
<div ref={rootRef} className="ReactQueryDevtools">
<Container ref={rootRef} className="ReactQueryDevtools">
{isResolvedOpen ? (
<ThemeProvider theme={theme}>
<ReactQueryDevtoolsPanel
Expand Down Expand Up @@ -192,7 +193,7 @@ export function ReactQueryDevtools({
<Logo aria-hidden />
</button>
)}
</div>
</Container>
)
}

Expand Down