Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@pietile-native-kit/fade-view
Advanced tools
Changes content with FadeOut-FadeIn animation. FadeView
uses data
prop to know when start
the transition. Useful in situations when you want to change content smoothly, implementing tabs
content for example.
Using yarn
yarn add @pietile-native-kit/fade-view
or using npm
npm install -S @pietile-native-kit/fade-view
Wrap the content in FadeView
and set data
to value that controls content. Every time data
changes FadeView
will remember children, play FadeOut animation and then FadeIn with current children
already. So it's important to notice that FadeView
passthrough children all the time except when
playing FadeOut.
import React, { Component } from 'react';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
import { FadeView } from '@pietile-native-kit/fade-view';
class FadeViewExample extends Component {
state = { isCat: true };
onPress = () => this.setState(({ isCat }) => ({ isCat: !isCat }));
render() {
const { isCat } = this.state;
return (
<FadeView style={styles.container} data={isCat}>
<TouchableOpacity
style={[styles.touchable, { backgroundColor: isCat ? '#c4c' : '#bfb' }]}
onPress={this.onPress}
>
<Text style={styles.text}>{isCat ? '🐱' : '🐶'}</Text>
</TouchableOpacity>
</FadeView>
);
}
}
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
justifyContent: 'center',
alignItems: 'center',
},
touchable: {
borderRadius: 16,
padding: 16,
},
text: {
fontSize: 86,
},
});
export default FadeViewExample;
name | description | type | default |
---|---|---|---|
children | Content | Node | - |
data | Marker property for telling the FadeView to do FadeOut-FadeIn | any | - |
duration | Hide and show animations duration | number | 150 |
style | Style of component | style | - |
Pietile FadeView is MIT License.
FAQs
View that changes content gracefully
We found that @pietile-native-kit/fade-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.