Every line of 'react native reanimated npm' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
91 export function useNativeValue(node: Animated.Node, init: number): number { 92 const [state, setState] = useState(init) 93 Animated.useCode(() => Animated.call([node], ([val]) => setState(val)), []) 94 return state 95 }
35 value: function __startNativeAnimation(animatedValue) { 36 animatedValue.__makeNative(); 37 38 this.__nativeId = NativeAnimatedHelper.generateNewAnimationId(); 39 NativeAnimatedHelper.API.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), this.__getNativeAnimationConfig(), this.__debouncedOnEnd.bind(this)); 40 }
71 componentDidMount() { 72 this.context.animationAgent.mountAnimated(this); 73 this.context.animationAgent.updateAnimated(this); 74 }
74 setNativeView(animatedView) { 75 if (this._animatedView === animatedView) { 76 return; 77 } 78 this._animatedView = animatedView; 79 80 const nativeViewTag = ReactNative.findNodeHandle(this._animatedView); 81 invariant( 82 nativeViewTag != null, 83 'Unable to locate attached view in the native tree' 84 ); 85 this._connectAnimatedView(nativeViewTag); 86 }
129 value: function setNativeView(animatedView) { 130 if (this._animatedView === animatedView) { 131 return; 132 } 133 134 this._animatedView = animatedView; 135 136 if (this.__isNative) { 137 this.__connectAnimatedView(); 138 } 139 }
120 connectAnimatedNodeToView(nodeTag: number, viewTag: number) { 121 const viewName = this.bridge.uiManager.viewNameForReactTag(viewTag); 122 invariant(viewName, `No such viewName for react tag ${viewTag}`); 123 this.addOperationBlock((nodesManager) => { 124 nodesManager.connectAnimatedNodeToView(nodeTag, viewTag, viewName); 125 }); 126 }
22 _activateAV=new _reactNative.Animated.Value(_this.props.active?1:0),_temp),_possibleConstructorReturn(_this,_ret);}_createClass(BottomNavigationIcon,[{key:'componentWillReceiveProps',value:function componentWillReceiveProps(next){var active=this.props.active;if(!active&&next.active){_index.Animations.standard(this._activateAV).start();}if(active&&!next.active){_index.Animations.standard(this._activateAV,{toValue:0}).start();}}},{key:'render',value:function render() 23 24 { 25 var AnimatedIcon=_reactNative.Animated.createAnimatedComponent(_index.Icon); 26 var AnimatedBody1=_reactNative.Animated.createAnimatedComponent(_index.Body1);var _props= 27 28 this.props,name=_props.name,text=_props.text,theme=_props.theme,other=_objectWithoutProperties(_props,['name','text','theme']); 29 30 delete other.active; 31 32 var styles=tStyles(theme); 33 34 return( 35 _react2.default.createElement(_index.TouchableRipple,_extends({ 36 rippleCentered:true, 37 rippleSpread:0.3, 38 rippleColor:theme.colors.primary}, 39 other), 40 _react2.default.createElement(_reactNative.Animated.View,{ 41 style:[ 42 styles.base, 43 (0,_uranium.animate)(styles.base,styles.active,this._activateAV)]}, 44 45 _react2.default.createElement(AnimatedIcon,{ 46 name:name, 47 style:(0,_uranium.animate)(styles.icon,styles.iconActive,this._activateAV)}), 48 _react2.default.createElement(AnimatedBody1,{ 49 style:(0,_uranium.animate)(styles.text,styles.textActive,this._activateAV)}, 50 text)))); 51 52 53 54 55 }}]);return BottomNavigationIcon;}(_react.Component);
185 function createAnimatedValue(value: number): AnimatedValue { 186 globalManager = globalManager || new Manager(); 187 return new AnimatedValue(value, globalManager); 188 }
30 constructor(bridge: RCTBridge) { 31 super(bridge); 32 33 this.bridge = bridge; 34 this.nodesManager = new RCTNativeAnimatedNodesManager( 35 this.bridge.uiManager 36 ); 37 38 this.operations = []; 39 this.preOperations = []; 40 41 this.bridge.eventDispatcher.addDispatchObserver(this); 42 this.bridge.uiManager.observerCoordinator.addObserver(this); 43 }
174 _connectAnimatedView(nativeViewTag) { 175 if (ReanimatedModule.connectNodeToView) { 176 ReanimatedModule.connectNodeToView(this.__nodeID, nativeViewTag); 177 } else { 178 this.__dangerouslyRescheduleEvaluate(); 179 } 180 }