
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
react-native-simple-default-props
Advanced tools
Simplest way to set default props for react-native components
Simplest way to set default props of any react-native components even Custom Component
react-native-global-props has not update since Oct 2018
It's useful but not work in some cases and import every single function for each component are not smart
So I used my own version
recently I thouhgt someone has same needs,
I hope react-native-simple-default-props could help you
npm i react-native-simple-default-props
or
yarn add react-native-simple-default-props
// import
import setDefaultProps from 'react-native-simple-default-props'
// use
setDefaultProps(Component, props)
import React from 'react';
import {Text, TextInput, SafeAreaView} from 'react-native';
import setDefaultProps from 'react-native-simple-default-props'
const defaultText = {
style: [{color: 'orange'}, {fontSize: 30}],
};
// usage
setDefaultProps(Text, defaultText);
setDefaultProps(TextInput, {
underlineColorAndroid: 'transparent',
placeholder: 'this is placeholder',
style: {
fontSize: 30,
padding: 0,
},
});
// work with Custom Component also
const CustomComponent = ({text = '', ...props}) => {
return (
<SafeAreaView {...props}>
<Text>{text}</Text>
</SafeAreaView>
);
};
setDefaultProps(CustomComponent, {style: {backgroundColor: 'lightgreen'}});
const App = () => {
return (
<SafeAreaView style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text>TEXT</Text>
<TextInput />
<CustomComponent text="CustomComponent1" />
<CustomComponent text="CustomComponent2" />
</SafeAreaView>
);
};
export default App;
FAQs
Simplest way to set default props for react-native components
The npm package react-native-simple-default-props receives a total of 700 weekly downloads. As such, react-native-simple-default-props popularity was classified as not popular.
We found that react-native-simple-default-props 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.