Skip to content

Instantly share code, notes, and snippets.

@nsrau
Last active August 26, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsrau/1deb562e8df4f0a8517db36c7d2e020e to your computer and use it in GitHub Desktop.
Save nsrau/1deb562e8df4f0a8517db36c7d2e020e to your computer and use it in GitHub Desktop.
var React__default = React;
var PluginOne = function PluginOne(_ref) {
var count = _ref.count,
handlerClick = _ref.handlerClick;
var _useState = React.useState(count),
state = _useState[0],
setState = _useState[1];
return React__default.createElement("div", null, React__default.createElement("h2", null, "Plugin One"), React__default.createElement("hr", null), React__default.createElement("button", {
onClick: function onClick() {
var newCount = state + 1;
handlerClick(newCount);
setState(newCount);
}
}, "count +"), React__default.createElement("button", {
onClick: function onClick() {
var newCount = state - 1;
handlerClick(newCount);
setState(newCount);
}
}, "count -"), React__default.createElement("hr", null), React__default.createElement("h4", null, "plugin one count: ", state));
};
window.PluginOne = PluginOne;
console.log('load from gist')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment