Home  >  Q&A  >  body text

How to use react in jsp page?

React normally, react-dom. Use react to insert components into a jsp page and report syntax errors. Can react be used in jsp? If it can be used, how should it be used? ?

天蓬老师天蓬老师2684 days ago1336

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-06-14 10:55:46

    First of all, you have to determine whether the react in your jsp page is written in es6 or es5. If you just want to use react in the jsp page, introduce the two packages react and react-dom and follow Ruan Yifeng's tutorial. Write, use es5 syntax to write

    reply
    0
  • 黄舟

    黄舟2017-06-14 10:55:46

    Essentially it is possible, because they are all js code. The reason for saving may be that the latest version of react uses es6 syntax, but your browser does not support it. You can always use Babel to convert your react code to es5

    reply
    0
  • Cancelreply