You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
I'm working on a project with a big Ui File which exports a lot of components like Buttons, Boxes, Text-Components, etc.
I'd like those to behave as similarily as possible. I.e. I'd like them all to use innerRef to be able to access the underlying DOM-Node.
For wrapping plain html-tags (glamorous('div')({...})) this works as expected.
Now if I want to wrap a Component like a React-Router Link I can do const WrappedLink = glamorous(Link)({})
If I write <WrappedLink innerRef={...}/>innerRef gives me the reference to the Link Component. However I would like to do something like this:
However I don't really like relying on ReactDOM.findDOMNode. First it's not cross-plattform, and second, it's possible that innerRef and ReactDOM.findDOMNode might return different nodes* in which case I want to rely on the result of innerRef.
*Think of something like <Container><input ref={this.props.innerRef}/></Container>
Hi @danielberndt,
I don't see any reason to disallow opting-into forwarding innerRef as you have here. I'd be open to a pull request with the implementation and tests 👍
I'm working on a project with a big
Ui
File which exports a lot of components like Buttons, Boxes, Text-Components, etc.I'd like those to behave as similarily as possible. I.e. I'd like them all to use
innerRef
to be able to access the underlying DOM-Node.For wrapping plain html-tags (
glamorous('div')({...})
) this works as expected.Now if I want to wrap a Component like a React-Router
Link
I can doconst WrappedLink = glamorous(Link)({})
If I write
<WrappedLink innerRef={...}/>
innerRef
gives me the reference to theLink
Component. However I would like to do something like this:such that
innerRef
now is passed to theLink
component yielding its underlying DOM-Node.I believe that fixing this line could resolve this issue.
Do you believe it's worthwhile pursuing? If so I'm happy to do a PR :)
The text was updated successfully, but these errors were encountered: