Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onClick={() => {
set({
...overrides.value,
[overrideKey]: {
style: formatCode(overrides.value[overrideKey].style),
active: true,
},
});
}}
>
onClick={() => {
const newCode = formatCode(
toggleOverrideSharedProps(
overrides.value[overrideKey].style,
Object.keys(overrides.custom.sharedProps),
),
);
set({
...overrides.value,
[overrideKey]: {
style: newCode,
active: true,
},
});
}}
>
let errored = false;
try {
if (props.type.component.value.name === '$Shape') {
value = props.type.component.typeParams.params[0];
name = value.value.referenceIdName;
} else {
value = props.type.component.value;
name = value.referenceIdName;
}
const proptypes = getPropTypes(value).map(property => {
return convert(property, true);
});
definition = formatCode(`type ${name} = {` + proptypes.join(',') + '}');
} catch (e) {
errored = true;
}
if (errored) {
return (
<div>
<p>
extract-react-types is not being run in dev mode for speed reasons. If
you need to see prop types, run:
</p></div>