Overriding style
See original GitHub issueSince https://github.com/gcanti/tcomb-form-native/commit/869dd50b2aca4c581c0a964edc251bd94815e964, I can’t properly override tcomb-form-native
style.
- tcomb-form-native v0.6.1
- react-native v0.31.0
Here is how I override tcomb Form style:
import {stylesheet} from './style';
t.form.Form.stylesheet = stylesheet;
Here is my code:
render() {
return = (
<t.form.Form
{...this.props} // props does not contain any stylesheet
context={{
onTiming: this.onTiming,
onLocation: this.onLocation,
getTimeSpend: this._getTimeSpend
}}
onChange={this.onChange}
options={this.state.options}
ref="form"
/>
);
}
In my custom component:
export class Group extends t.form.Struct {
getTemplate() {
return (locals) => {
var stylesheet = locals.stylesheet; // unaware of anything that has been overriden
var groupStyle = stylesheet.group.normal;
return (<View style={groupStyle}>
{t.form.Form.templates.struct(locals)}
</View>);
};
}
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
How to Override CSS Styles - W3docs
An !Important declaration is a great way to override the styles you want. When an important rule is used on a style declaration,...
Read more >Override Inline Styles with CSS
Often we think of inline styles as a way to override styles we set up in the CSS. 99% of the time, this...
Read more >How can I override inline styles with external CSS?
The only way to override inline style is by using !important keyword beside the CSS rule. The following is an example of it....
Read more >How CSS style overriding works ? - GeeksforGeeks
Overriding : Overriding in CSS means that you are providing any style property to an element for which you have already provided a...
Read more >Overriding Style Definitions - XMPie Help Center
In a Style Content Object, you can override InDesign style definitions with alternative font size, font style, and font color. The override color...
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 FreeTop 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
Top GitHub Comments
@mxmtsk That’s because you import
tcomb-form-native
in other places. Take a look atindex.js
. You can figure it out easily.Hi @btoueg!
Sorry, never user stylesheet override. Can you pass your stylesheet through the options object?