Closed peitalin closed 5 years ago
E.g for a code block like this:
render() { return ( <div> { this.showIfTrue && <Modal/> } <div> ) }
The last } will not be correctly highlighted.
}
You'll need to wrap the <Modal/> element inside the JS-block (inside the JSX-block) in parentheses:
<Modal/>
render() { return ( <div> { this.showIfTrue && (<Modal/>) } <div> ) }
Alternatively, I've been wrapping the entire block in parentheses for consistency:
render() { return ( <div> {( this.showIfTrue && <Modal/> )} <div> ) }
Any plans to fix this issue?
The workaround will not work for projects that use prettier for they code formatting.
prettier
Should be fixed now.
Should also work for react fragments syntax as well now.
E.g for a code block like this:
The last
}
will not be correctly highlighted.You'll need to wrap the
<Modal/>
element inside the JS-block (inside the JSX-block) in parentheses:Alternatively, I've been wrapping the entire block in parentheses for consistency: