![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@react-native-component/react-native-smart-badge
Advanced tools
A smart auto-fit badge for React Native apps
A smart autofit badge for react-native apps, written in JS for cross-platform support. It works on iOS and Android.
This component is compatible with React Native 0.25 and newer.
npm install react-native-smart-badge --save
or
npm install @react-native-component/react-native-smart-badge --save
Install the button from npm with npm install @react-native-component/react-native-smart-badge --save
.
Then, require it from your app's JavaScript files with import Button from '@react-native-component/react-native-smart-badge'
.
import Badge from '../../react-native-smart-badge'
export default class NumberBadge extends Component {
// 构造
constructor(props) {
super(props);
// 初始状态
this.state = {
num1: 2,
num2: 15,
num3: 328,
};
}
render() {
return (
<View style={{marginTop: 20 + 44, flex: 1, justifyContent: 'center', alignItems: 'center', }}>
<Badge textStyle={{color: '#fff',}}>
{this.state.num1}
</Badge>
<Badge textStyle={{color: '#fff',}} style={{marginTop: 10,}}>
{this.state.num2}
</Badge>
<Badge textStyle={{color: '#fff',}} style={{marginTop: 10,}}>
{this.state.num3}
</Badge>
<Text style={{marginTop: 10, padding: 3,}} onPress={this._addNum}>click to add num(点击增加数字)</Text>
</View>
)
}
_addNum = () => {
this.setState({
num1: this.state.num1 + 3,
num2: this.state.num2 + 30,
num3: this.state.num3 + 300,
})
}
}
Prop | Type | Optional | Default | Description |
---|---|---|---|---|
extraPaddingHorizontal | number | Yes | 10 | determines the value of extra horizontal padding when the badge's width is larger than height. |
style | style | Yes | see react-native documents | |
textStyle | style | Yes | see react-native documents |
FAQs
A smart auto-fit badge for React Native apps
The npm package @react-native-component/react-native-smart-badge receives a total of 0 weekly downloads. As such, @react-native-component/react-native-smart-badge popularity was classified as not popular.
We found that @react-native-component/react-native-smart-badge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.