script-lab
script-lab copied to clipboard
How to use react in script-lab
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" />);
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.
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.