
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-native-default-props
Advanced tools
Function to override the default props of any react-native component
Simple function to override the default props of any react-native component.
Set the default props of any component once and they will be set everywhere in your project. No need to export or import custom components, just bind them to the original ones.
We have encountered a lot of situations where we were using specific props at different locations throughout a single react-native project. For example, we wanted the activeOpacity prop of the TouchableOpacity component to be the same everywhere in the project.
This can be done by creating a custom component around the TouchableOpacity and by using this wrapper-component everywhere instead of the original TouchableOpacity component. However, this is extra overhead that we should avoid for such a small adjustment. This library aims to solve this issue by overriding the default props of various components in order to reduce boilerplate code and make it easier to define a global theme of your project.
The inspiration for this library comes from react-native-global-props. The reason we have created our own library is that we do not want to be limited to the components that the library supports and we prefer a more generic approach. This library only contains ~5% of the code but supports even more components due to the generic structure.
$ yarn add react-native-default-props
import { TouchableOpacity } from 'react-native';
import customize from 'react-native-default-props';
customize(TouchableOpacity, {
activeOpacity: 0.8,
});
This library is published under the MIT license. The full license can be found in this repo.
FAQs
Function to override the default props of any react-native component
The npm package react-native-default-props receives a total of 0 weekly downloads. As such, react-native-default-props popularity was classified as not popular.
We found that react-native-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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.