Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100921071
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
Mon, Feb 3, 23:29
Size
960 B
Mime Type
text/x-java
Expires
Wed, Feb 5, 23:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24054115
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