0

I want to recreate this multiply effect in my own snippet, but for a React component, as featured here:

Emmet in vscode


Typing [componentName]*3 will create:

<ComponentName/>
<ComponentName/>
<ComponentName/>

If possible it would ideal if typing [componentName],*3 would create:

<ComponentName/>,
<ComponentName/>,
<ComponentName/> //note the missing comma here!

I was trying to figure this out from the Emmet and snippet documentation on the VSCode site but was unsuccessful.

Thanks!

Jack
  • 397
  • 4
  • 13
  • Comma is not allowed in Emmet abbreviations. Why would you need a comma after tag? – Sergey Chikuyonok Sep 10 '20 at 14:15
  • You should show how you got `[componentName]*3` to expand to what you have already. – Mark Sep 10 '20 at 16:32
  • @Mark, that's part of the issue, I don't know how to do that in Emmet. – Jack Sep 10 '20 at 21:37
  • @SergeyChikuyonok I'm passing components as `props` using [mixed arrays](https://stackoverflow.com/questions/19266197/reactjs-convert-html-string-to-jsx) of HTML components and strings. Do you have a suggestion about how to do it differently? – Jack Sep 10 '20 at 21:42
  • @Jack it requires custom support from Emmet side to properly support this feature. It might be added in future – Sergey Chikuyonok Sep 17 '20 at 14:30

0 Answers0