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

Export valid attachment position #26

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@slorber
Contributor

slorber commented Aug 1, 2016

I'd like these to be exported so that lib clients can validate position on their side without duplicating this list.
In my case I built a wrapper for a tooltip component and I'd like my wrapper to also declare proptypes.
Also need ability to validate positions at app startup time (ie I create HOC using positions) instead or runtime

Maybe my usecase is not that clear but I'm sure it's not a big deal to export these positions anyway

Export valid attachment position
I'd like these to be exported so that lib clients can validate position on their side without duplicating this list.
In my case I built a wrapper for a tooltip component and I'd like my wrapper to also declare proptypes. 
Also need ability to validate positions at app startup time (ie I create HOC using positions) instead or runtime

Maybe my usecase is not that clear but I'm sure it's not a big deal to export these positions anyway
@souporserious

This comment has been minimized.

Collaborator

souporserious commented Aug 7, 2016

How would someone consume this if it's being exported like that? Not sure I understand how it would work.

@slorber

This comment has been minimized.

Contributor

slorber commented Aug 8, 2016

export const OnbooardingHotspot = React.createClass({
  propTypes: {
    hotspotPosition: ReactTether.PositionPropType.isRequired,
  }
})

just if I build a wrapper around react-tether that expose a position prop i'd like to not declare list of position myself in my own code.

@souporserious

This comment has been minimized.

Collaborator

souporserious commented Aug 16, 2016

Totally. I can't get it to work by calling TetherComponent.attachmentPositions though. Wondering if there is any way to do that? Maybe make it a getter or something. Seems kind of weird though.

@souporserious

This comment has been minimized.

Collaborator

souporserious commented Oct 19, 2016

These should fall through your component and into the PropTypes of this one if the attachment position is not valid, right? If this is not the case, I'll reconsider exporting them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment