@cloudscape-design/component-toolkit
Advanced tools
Comparing version
@@ -22,1 +22,2 @@ export { useComponentMetadata, COMPONENT_METADATA_KEY } from './base-component/component-metadata'; | ||
export { useRandomId, useUniqueId } from './use-unique-id'; | ||
export { validateProps } from './base-component/validate-props'; |
@@ -24,1 +24,2 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
export { useRandomId, useUniqueId } from './use-unique-id'; | ||
export { validateProps } from './base-component/validate-props'; |
{ | ||
"commit": "dca135357f63d956c4a7ce666f50752a202aef85" | ||
"commit": "072bd91f1f373f2622f6ecd02a411cf67cd62c83" | ||
} |
@@ -35,11 +35,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
const useSingleton = createSingletonHandler(factory); | ||
let value = initialState; | ||
return function useSingletonState() { | ||
const [state, setState] = useState(value); | ||
useSingleton(newValue => { | ||
value = newValue; | ||
setState(newValue); | ||
}); | ||
const [state, setState] = useState(initialState); | ||
useSingleton(setState); | ||
return state; | ||
}; | ||
} |
{ | ||
"name": "@cloudscape-design/component-toolkit", | ||
"version": "1.0.0-beta.111", | ||
"version": "1.0.0-beta.112", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "container-queries", |
113131
0.88%101
2.02%2281
0.66%