Last active
August 26, 2020 12:55
-
-
Save nsrau/1deb562e8df4f0a8517db36c7d2e020e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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