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

refs/children are not working #7

Open
piranha opened this issue Oct 6, 2013 · 1 comment
Open

refs/children are not working #7

piranha opened this issue Oct 6, 2013 · 1 comment

Comments

@piranha
Copy link
Owner

piranha commented Oct 6, 2013

00:17 petehunt: piranha: https://github.com/facebook/react/blob/master/src/core/ReactComponent.js#L349
00:17 petehunt: that line and the one after it do props.ref, you should be able to only change those 2 places and it should work
00:18 piranha: petehunt: hmm... do you think I could do that externally somehow?
00:18 piranha: petehunt: to not break into React...
00:18 petehunt: piranha: heh, probably not
00:18 piranha: maybe with plugin somehow?
00:19 piranha: or monkeypatching... :))
00:19 petehunt: piranha: yeah, you could monkeypatch the method
00:19 piranha: I mean I would love to fix that, but I don't think you guys would appreciate my pull request, as it would be quite irrelevant to react's sources :)
00:19 piranha: petehunt: is there a good way to get to ReactComponent from outside? Or I have to hook in with modules somehow?
00:20 petehunt: piranha: i am not sure if we would take it (need to think about it more), but you could basically abstract props.ref to be like ReactRefs.getRef(component) and make ReactRefs injectable
00:20 piranha: hoho that would be good
00:20 petehunt: piranha: if you are using commonjs you can require it, otherwise i don't think so
00:20 piranha: 'children' thing is the same issue, just other way around - setting it
00:20 piranha: yeah, I'm using goog.require stuff unfortunately (it's what CLJS uses)
00:21 piranha: I need to learn how do you do those ReactRefs, though
00:21 petehunt: piranha: this could be relevant to stuff that i actually want to do (pooling props objects), but it's not high priority. if you could do it and do it in a way that doesn't change the code too much (like the one i suggested) it could be cool
00:21 petehunt: piranha: just look at ReactOwner.addComponentAsRefTo()
@piranha
Copy link
Owner Author

piranha commented Oct 6, 2013

@petehunt following your idea with ReactRefs wasn't hard, but in the end I don't know how this can help me... though I certainly could do separate cljs-flavored build of React then...

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

No branches or pull requests

1 participant