|
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? |
Answered by
optimajet
Jul 29, 2024
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>
);
}; |
0 replies
Answer selected by
azrlucky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @azrlucky,
Of course you can. To do this, you need to use the
useComponentDatahook (https://formengine.io/documentation/api-reference/@react-form-builder/core/functions/useComponentData).The
keyproperty can be found here - https://formengine.io/documentation/api-reference/@react-form-builder/core/classes/ComponentData#key.