How can I implement SSL Certificate Pinning while using React Native

After exhausting the current spectrum of available options from Javascript I decided to simply implement certificate pinning natively it all seems so simple now that I’m done. Skip to headers titled Android Solution and IOS Solution if you don’t want to read through the process of reaching the solution. Android Following Kudo’s recommendation I thought … Read more

Focus style for TextInput in react-native

You can achieve this by passing in the onFocus and onBlur events to set and unset styles when focused and blurred: onFocus() { this.setState({ backgroundColor: ‘green’ }) }, onBlur() { this.setState({ backgroundColor: ‘#ededed’ }) }, And then, in the TextInput do this: <TextInput onBlur={ () => this.onBlur() } onFocus={ () => this.onFocus() } style={{ height:60, … Read more

Call child function from parent component in React Native

Nader Dabit’s answer is outdated, since using String literals in ref attributes has been deprecated. This is how we would do it as of September 2017: <Child ref={child => {this.child = child}} {…this.props} /> <Button onPress={this.child.myfunc} /> Same functionality, but instead of using a String to reference the component, we store it in a global … Read more

Animating backgroundColor in React Native

Given you have Animated.Value lets say x, you can interpolate color like this: render() { var color = this.state.x.interpolate({ inputRange: [0, 300], outputRange: [‘rgba(255, 0, 0, 1)’, ‘rgba(0, 255, 0, 1)’] }); return ( <Animated.View style={{backgroundColor:color}}></Animated.View> ); } You can find full working example in the issue I’ve posted on github.

React-Native, Scroll View Not Scrolling

It’s a typo: Your closing ScrollView tag is: </SCrollView> rather than </ScrollView>. You also need to add a style to the View container, here’s an example of what it should look like: return( <View style={{flex: 1}}> <ScrollView> <Text> TEST </Text> <Text> TEST </Text> <Text> TEST </Text> <Text> TEST </Text> … </ScrollView> </View> );

However, this package itself specifies a `main` module field that could not be resolved

After a long research MetroJS bundler default not compile typescript .ts and .tsx extension files. We need tell MetroJS bundler to compile .ts and .tsx files i solved this error by edit metro.config.js file in root project folder by following. Edited on September 2022 Added cjx and json extensions to below snippet All extensions listed … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)