Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[react-jss] better typings for props passed to the inner component #886

Closed
kof opened this issue Oct 12, 2018 · 4 comments
Closed

[react-jss] better typings for props passed to the inner component #886

kof opened this issue Oct 12, 2018 · 4 comments
Labels
enhancement No kittens die if we don't do that.

Comments

@kof
Copy link
Member

kof commented Oct 12, 2018

Currently classes is defined as optional, because if option inject is used, it might not get passed. We need to investigate for a way to type it based on inject prop and make sure user doesn't have to do defensive programming because of that.

injectSheet(styles, {inject: ['sheet', 'classes', 'theme']})

Same problem with ts typings.

@kof kof added the enhancement No kittens die if we don't do that. label Oct 12, 2018
@HenriBeck
Copy link
Member

I don't think this is possible, at least with flow, might be doable with typescript though.

Is there a case for not injecting the classes prop though?

@kof
Copy link
Member Author

kof commented Oct 13, 2018

Dunno, one could use sheet and not use classes, seemed logically that if I can customize one prop, why not customize all of them. But I see your point, it could be a solution for mainstream, where you always use classes

@HenriBeck
Copy link
Member

I don't see any point where you would not want to inject the classes.
And sheet should only be injected when you need to access it which should rarely be.

An option which would make more sense to me is how the classes are merged.

@HenriBeck
Copy link
Member

Done in #934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement No kittens die if we don't do that.
Projects
None yet
Development

No branches or pull requests

2 participants