import React from "react";
import { TextBoxControlled } from "../TextBox";

const ParentComponent = props => {
  let [myText, setText] = React.useState('');
  return /*#__PURE__*/React.createElement("div", null, props.component({
    myText,
    setText
  }), /*#__PURE__*/React.createElement("button", {
    onClick: () => {
      setText('Set Controlled value via button');
    }
  }, "Set Controlled "));
};

export function TextBoxControlledExample() {
  return /*#__PURE__*/React.createElement(ParentComponent, {
    component: _ref => {
      let {
        myText
      } = _ref;
      return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextBoxControlled, {
        value: myText,
        placeholder: "set controlled defaultvalue set via button",
        onChange: () => {}
      }), " ");
    }
  });
}