script-lab icon indicating copy to clipboard operation
script-lab copied to clipboard

How to use react in script-lab

Open Edward-Zhou opened this issue 2 years ago • 1 comments

I want to confirm whether we can use react in script-lab like

class HelloMessage extends React.Component {
  render() {
    return <div>Hello {this.props.name}</div>;
  }
}

root.render(<HelloMessage name="Taylor" />);

Edward-Zhou avatar May 20 '22 11:05 Edward-Zhou

Maybe...... but it's NOT necessary at all. The key point of Script lab is "Script", not the UI, so it is better to focus more on the script part.

If you want to have some good functions in the UI, you can use jQuery instead. it's supported by default.

chenxizhang avatar Sep 04 '22 13:09 chenxizhang

I would not use React in Script Lab - it is not a supported scenario.

If you need to use react I recommend creating a full Add-In.

You can create and host your own Add-In on GitHub, for example see the Build Add-In you can sideload the manifest.

wandyezj avatar Apr 04 '24 19:04 wandyezj