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

fix react-dom imports #74

Merged
merged 1 commit into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/alert-dialog/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { createContext, forwardRef } from "react";
import React from "react";
import Component from "@reach/component-component";
import { DialogOverlay, DialogContent } from "@reach/dialog";
import { Consumer as IdConsumer } from "@reach/utils/lib/IdContext";
import invariant from "invariant";

let AlertDialogContext = createContext();
let AlertDialogContext = React.createContext();

let AlertDialogOverlay = ({ leastDestructiveRef, ...props }) => (
<IdConsumer>
Expand Down
4 changes: 2 additions & 2 deletions packages/alert/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// later.

import React from "react";
import { render } from "react-dom";
import ReactDOM from "react-dom";
import Component from "@reach/component-component";
import VisuallyHidden from "@reach/visually-hidden";

Expand Down Expand Up @@ -42,7 +42,7 @@ let renderAlerts = () => {
Object.keys(elements).forEach(type => {
let container = liveRegions[type];
if (container) {
render(
ReactDOM.render(
<VisuallyHidden>
<div
role={type === "assertive" ? "alert" : "status"}
Expand Down
6 changes: 3 additions & 3 deletions packages/component-component/examples/todo-list.example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Fragment } from "react";
import React from "react";
import Component from "../src/index";

export let name = "Kitchen Sink Todo List";
Expand All @@ -15,7 +15,7 @@ export let Example = () => (
})}
>
{({ state, setState, refs }) => (
<Fragment>
<React.Fragment>
<Component
didUpdate={() =>
localStorage.setItem("todos", JSON.stringify(state.todos))
Expand Down Expand Up @@ -70,7 +70,7 @@ export let Example = () => (
</button>
</p>
</div>
</Fragment>
</React.Fragment>
)}
</Component>
);
4 changes: 2 additions & 2 deletions packages/menu-button/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { createContext } from "react";
import React from "react";
import Portal from "@reach/portal";
import { Link } from "@reach/router";
import Rect from "@reach/rect";
Expand All @@ -7,7 +7,7 @@ import Component from "@reach/component-component";
import { node, func, object, string, number, oneOfType } from "prop-types";
import { wrapEvent, checkStyles } from "@reach/utils";

let { Provider, Consumer } = createContext();
let { Provider, Consumer } = React.createContext();

let checkIfAppManagedFocus = ({ refs, state, prevState }) => {
if (!state.isOpen && prevState.isOpen) {
Expand Down
4 changes: 2 additions & 2 deletions packages/portal/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { createPortal } from "react-dom";
import ReactDOM from "react-dom";
import Component from "@reach/component-component";

let Portal = ({ children, type = "reach-portal" }) => (
Expand All @@ -14,7 +14,7 @@ let Portal = ({ children, type = "reach-portal" }) => (
document.body.removeChild(node);
}}
render={({ refs: { node } }) => {
return node ? createPortal(children, node) : null;
return node ? ReactDOM.createPortal(children, node) : null;
}}
/>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/lib/IdContext.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { createContext } from "react";
import React from "react";

// most things that we auto-id aren't server rendered, and are rendered into
// portals anyway, so we can get away with random ids in a default context. If
Expand All @@ -9,7 +9,7 @@ let genId = () =>
.toString(32)
.substr(2, 6);

let IdContext = createContext(genId);
let IdContext = React.createContext(genId);

// Apps can wrap their app in this to get the same IDs on the server and the
// client
Expand Down