Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120421656
useTabs.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 4, 06:36
Size
960 B
Mime Type
text/x-java
Expires
Sun, Jul 6, 06:36 (2 d)
Engine
blob
Format
Raw Data
Handle
27186342
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
useTabs.js
View Options
import * as React from 'react';
import { unstable_useControlled as useControlled, unstable_useId as useId } from '@mui/utils';
const useTabs = parameters => {
const {
value: valueProp,
defaultValue,
onChange,
orientation,
direction,
selectionFollowsFocus
} = parameters;
const [value, setValue] = useControlled({
controlled: valueProp,
default: defaultValue,
name: 'Tabs',
state: 'value'
});
const idPrefix = useId();
const onSelected = React.useCallback((e, newValue) => {
setValue(newValue);
if (onChange) {
onChange(e, newValue);
}
}, [onChange, setValue]);
const tabsContextValue = React.useMemo(() => {
return {
idPrefix,
value,
onSelected,
orientation,
direction,
selectionFollowsFocus
};
}, [idPrefix, value, onSelected, orientation, direction, selectionFollowsFocus]);
return {
tabsContextValue
};
};
export default useTabs;
Event Timeline
Log In to Comment