Override style not working
See original GitHub issueIssue Description
Hello, I did:
import { setCustomTextInput } from "react-native-global-props";
const customTextInputProps = {
style: {
//fontFamily: theme.fontFamily.regular,
//color: theme.colors.text,
backgroundColor: "#E0E7FF33",
borderColor: "#E0E7FF",
borderRadius: 5,
borderWidth: 1,
marginVertical: 5,
paddingVertical: 7,
paddingHorizontal: 18,
fontSize: 14,
fontFamily: theme.fontFamily.regular,
//color: "red"
}
};
setCustomTextInput(customTextInputProps);
If I write:
<TextInput value={code} />
The global styles are applied correctly
But if I try to override one property of the style for a particular TextInput, the global styles dissapear, for example writting:
<TextInput
value={code}
style={{color: "red"}}
/>
It only apply the red color, and the rest of the style is gone. No border, no padding, etc.
What I’m doing wrong?
If I do:
<TextInput
value={code}
style={[TextInput.defaultProps.style, {color: "red"}]}
/>
It worked as expected… But then… whats the point using this library?
Can you help me please?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Custom Class Not Overriding Other CSS - html - Stack Overflow
When I wrap a chunk of a page in the text and background change but the links and headlines remain white (and are...
Read more >How to fix style override issues - EventON - Documentation
Step 3: Write a CSS style to override this issue. Get the class name of the style that is overridden in EventON (in...
Read more >Css override not working - OutSystems
Hello,. I'm trying to override (display: inline-block; ) in Basic.css file by creating a class in my own css file:
Read more >How to Override CSS Styles - W3docs
How CSS overriding works, what is the cascading order and inheritance, what are the priorities and some tricks to override them.
Read more >How to Edit, Customize, and Override Bootstrap CSS to Suit ...
Learn how to override Bootstrap CSS using simple CSS overrides or Sass variables and maps to customize your site.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To anyone experiencing this issue, it seems this only happens when Hermes is enabled. it worked as expected when I disabled Hermes in the project.
Is there any plan to make it work with Hermes please ?