0👍
When using a string it works in the below snippet. Are you sure the JSON.parse(JSON.stringify(props.formMethod))
is returning "makeUserSignInForm" as a string?
const directur = {
makeUserSignInForm: 'Hello',
};
// const accessor = JSON.parse(JSON.stringify(props.formMethod));
const accessor = "makeUserSignInForm";
console.log(directur); // logs the object.
console.log(accessor); // makeUserSignInForm
console.log(directur.makeUserSignInForm); // Hello
console.log(directur['makeUserSignInForm']); // Hello
console.log(directur[accessor]); // Hello
Source:stackexchange.com