-
Hi Team, I am trying to make a complex custom component for which I need to get access of the key assigned to the custom component.
need access of the key like
Is it possible to achieve that and how? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @azrlucky, Of course you can. To do this, you need to use the The const VerifiedByControl = (props: any) => {
const componentData = useComponentData()
console.log('componentData', componentData.key);
console.log('VerifiedByControl', props);
return (
<div className={props.className}>
<VerifiedByCode value={props.value} onChange={props.onChange} />
</div>
);
}; |
Beta Was this translation helpful? Give feedback.
Hi @azrlucky,
Of course you can. To do this, you need to use the
useComponentData
hook (https://formengine.io/documentation/api-reference/@react-form-builder/core/functions/useComponentData).The
key
property can be found here - https://formengine.io/documentation/api-reference/@react-form-builder/core/classes/ComponentData#key.