Utilities: Add useExperimentalFlag hook
This commit DRYs out the code, extracting the logic for setting the value of the experimentalFlag into a new hook found in the utilities. It also makes the typing stricter - the hook returns a boolean. The pattern we were using previously to set the value of experimentalFlag variables could be boolean, string, or undefined.
This commit is contained in:
parent
baddf66273
commit
c73482dd7f
4 changed files with 32 additions and 14 deletions
|
|
@ -25,7 +25,7 @@ import { resolveRelPath } from '../../Utilities/path';
|
|||
import './ImageBuilderHeader.scss';
|
||||
|
||||
type ImageBuilderHeaderPropTypes = {
|
||||
experimentalFlag?: string | true | undefined;
|
||||
experimentalFlag?: boolean;
|
||||
};
|
||||
|
||||
export const ImageBuilderHeader = ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue