@storybook/addon-ondevice-controls
Version:
Display storybook controls on your device.
16 lines (15 loc) • 853 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const common_1 = require("./common");
const useResyncValue_1 = require("./useResyncValue");
const TextType = ({ arg, onChange, isPristine }) => {
const { setCurrentValue, key } = (0, useResyncValue_1.useResyncValue)(arg.value, isPristine);
const [focused, setFocused] = (0, react_1.useState)(false);
return ((0, jsx_runtime_1.jsx)(common_1.Input, { testID: arg.name, defaultValue: arg.value, onChangeText: (text) => {
onChange(text);
setCurrentValue(text);
}, autoCapitalize: "none", underlineColorAndroid: "transparent", onFocus: () => setFocused(true), onBlur: () => setFocused(false), focused: focused }, key));
};
exports.default = TextType;