react-native-redash
Version:
Utility library for React Native Reanimated
2 lines • 1.16 kB
JavaScript
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-redash/react-native-redash/src/ReText.tsx";var _excluded=["style","text"];import React,{useMemo}from"react";import{StyleSheet,TextInput}from"react-native";import Animated,{useAnimatedProps}from"react-native-reanimated";var styles=StyleSheet.create({baseStyle:{color:"black"}});Animated.addWhitelistedNativeProps({text:true});var AnimatedTextInput=Animated.createAnimatedComponent(TextInput);var ReText=function ReText(props){var style=props.style,text=props.text,rest=_objectWithoutProperties(props,_excluded);var initialValue=useMemo(function(){return text.value;},[text]);var animatedProps=useAnimatedProps(function(){return{text:text.value};});return React.createElement(AnimatedTextInput,_extends({underlineColorAndroid:"transparent",editable:false,value:initialValue,style:[styles.baseStyle,style||undefined]},rest,{animatedProps:animatedProps,__source:{fileName:_jsxFileName,lineNumber:31,columnNumber:5}}));};export default ReText;
//# sourceMappingURL=ReText.js.map