The vue render function return (<li> </li>) reports an error

I"m going to take out some components in the npm package to study.
then copy it out and introduce it. As a result,
the code in some packages looks like this:

 render() {
      return (
        <div class={portalTargetClass} style={portalTargetStyle} data-instance-id={instance.getInstanceId()}>
          <Menu ref="menu" />
        </div>
      )
    },

after packing, return reports an error here

Syntax Error: Unexpected token

but why don"t you report an error in the npm package? How should I change it?

May.04,2022

what you need is JSX Refer to the official website document: ide/render-function.html-sharpJSX" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide...
JSX details reference: https://github.com/vuejs/babe...


how do I feel this is a component of react ?


The

render method returns the createElement function to generate a template in createElement

render (createElement) {
    return createElement(
      'div',
      {
        class: portalTargetClass,
        style: portalTargetStyle
      }
    )
  }

how do you pack it? is the relevant babel plug-in not equipped with

Menu