mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
refactor(v2): combine nested theme providers into one (#2870)
This commit is contained in:
parent
2d8abe150f
commit
174cd8dc6f
11 changed files with 83 additions and 131 deletions
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, {useState, Children} from 'react';
|
||||
import useTabGroupChoiceContext from '@theme/hooks/useTabGroupChoiceContext';
|
||||
import useUserPreferencesContext from '@theme/hooks/useUserPreferencesContext';
|
||||
|
||||
import classnames from 'classnames';
|
||||
|
||||
|
@ -19,7 +19,7 @@ const keys = {
|
|||
|
||||
function Tabs(props) {
|
||||
const {block, children, defaultValue, values, groupId} = props;
|
||||
const {tabGroupChoices, setTabGroupChoices} = useTabGroupChoiceContext();
|
||||
const {tabGroupChoices, setTabGroupChoices} = useUserPreferencesContext();
|
||||
const [selectedValue, setSelectedValue] = useState(defaultValue);
|
||||
|
||||
if (groupId != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue