SyntaxFix
Write A Post
Hire A Developer
Questions
If you use ECMAScript 6, you can simply write like this.
// First, create a wrap object. const wrap = { [variableName]: true } // Then, use it <SomeComponent {...{wrap}} />