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

Add possibility to set className to rendered span #34

Closed
wants to merge 1 commit into from

Conversation

petrbrzek
Copy link

Sometimes is necessary to style span because of some non trivial page layout (e.g. using flexbox).

Sometimes is necessary to style span because of some non trivial page layout (e.g. using flexbox).
@lencioni
Copy link
Collaborator

Thanks for your interest in react-waypoint!

Is it possible to solve your issue by wrapping your waypoint with a span and styling that span instead? We believe that passing a className to components is an anti-pattern so we'd prefer to avoid expanding this component's API in this way. More info: https://medium.com/brigade-engineering/don-t-pass-css-classes-between-components-e9f7ab192785

@petrbrzek
Copy link
Author

Well, it's interesting and also kinda limiting. But I respect it. What about adding some default className to the <span> element like .waypoint to be more specific then just the bare element?

@trotzig
Copy link
Collaborator

trotzig commented Oct 31, 2015

I'm closing this without any action. I understand that a class name could be helpful and it isn't hard to add. But we want to stay consistent with how we deal with className props, and this is not the only component where we have been firm on the no-className policy. @petrbrzek I hope you don't feel like we're being overprotecting (I understand it might come across as such). And if adding a wrapper isn't possible in some scenarios, let us know and we can reconsider our policy. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants