question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Since 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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
jgkimcommented, Dec 20, 2016

@mxmtsk That’s because you import tcomb-form-native in other places. Take a look at index.js. You can figure it out easily.

1reaction
alvarombcommented, Nov 25, 2016

Hi @btoueg!

Sorry, never user stylesheet override. Can you pass your stylesheet through the options object?

const options = {
  stylesheet: stylesheet,
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found