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

Adding a React Component for establishing Context via React Trees #614

Closed
wants to merge 5 commits into from

Conversation

darthtrevino
Copy link
Member

@darthtrevino darthtrevino commented Jan 17, 2017

This will allow us to nest the DragDrop engine under an iframe. Note that the iframe window must be injected via context.

see #241
see react-dnd/dnd-core#37

@kesne
Copy link
Collaborator

kesne commented Jan 23, 2017

It seems weird to have users put the window object on the react context, I'm not sure what that solves?

@darthtrevino
Copy link
Member Author

The javascript at this point that's assembling the DOM is executed in the context of the outer window global, but the drag-and-drop context within the iframe needs to be constructed with the inner window to establish proper eventing.

@darthtrevino
Copy link
Member Author

We could probably use a prop to inject the inner window instead, but it seems kind of natural to use a context variable to replace a global ¯\(ツ)

@darthtrevino
Copy link
Member Author

I think what will make sense is to do the following checks to determine what window instance to use:

  1. Check the window prop on this component. If it has been explicitly set, that should take the highest precedent.
  2. Check the window context value. If this is available, it should be used.
  3. Use the standard window global.

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.

None yet

2 participants