Jss: Documentation - clarify where `link: true` goes

Created on 22 Jun 2018  路  5Comments  路  Source: cssinjs/jss

The JSS docs on observables mentions that one needs to use link: true, but does not mention where.

For example, given:

    this.styles = jss.createStyleSheet(this.css).attach()

It's not clear which of the following is correct:

    this.styles = jss.createStyleSheet(this.css, {link: true}).attach()
    this.styles = jss.createStyleSheet(this.css).attach({link: true})

Seems like it's neither; rather, if you trace .attach, it looks like it uses this.options.link, but the expected jss.options is undefined.

All to say, there's a gap that needs to be filled about where link: true goes.

docs question

All 5 comments

Here it says that observables need the Sheet option link: true.

Also the options for a Sheet a declared here: https://github.com/cssinjs/jss/blob/master/docs/js-api.md#create-style-sheet

But I think we could add an example with how to use observables.

Thanks @HenriBeck ; the ambiguity is whether the Sheet option is on the attach or the create call.

I don't get it, how did you come to think .attach() accepts an options argument? Please send a PR where you think its not clear.

@kof Trivial fix that would've saved 10-15 minutes of wandering around the docs is #739

yeah, I guess docs will never be perfect, thats one every one needs to send fixes like this one :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valZho picture valZho  路  7Comments

Telokis picture Telokis  路  3Comments

synchronos-t picture synchronos-t  路  4Comments

oliviertassinari picture oliviertassinari  路  6Comments

trusktr picture trusktr  路  6Comments