Skip to content

Commit

Permalink
Support for React v15
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Mar 15, 2016
1 parent 42317dd commit d5f027a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
#graphiql-container .variable-editor {
display: -webkit-flex;
display: flex;
height: 30px;
height: 29px;
-webkit-flex-direction: column;
flex-direction: column;
position: relative;
Expand Down
9 changes: 6 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
<html>
<head>
<style>
html, body {
body {
height: 100%;
margin: 0;
width: 100%;
overflow: hidden;
}
#graphiql {
height: 100vh;
}
</style>
<link rel="stylesheet" href="./graphiql.css" />
<script src="//cdn.jsdelivr.net/fetch/0.9.0/fetch.min.js"></script>
Expand All @@ -24,7 +27,7 @@
<script src="./graphiql.js"></script>
</head>
<body>
Loading...
<div id="graphiql">Loading...</div>
<script>

/**
Expand Down Expand Up @@ -117,7 +120,7 @@
onEditVariables: onEditVariables,
onEditOperationName: onEditOperationName
}),
document.body
document.getElementById('graphiql')
);
</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
},
"peerDependencies": {
"graphql": "^0.4.16",
"react": "^0.14.0",
"react-dom": "^0.14.0"
"react": "^0.14.0 || ^15.0.0-rc",
"react-dom": "^0.14.0 || ^15.0.0-rc"
},
"devDependencies": {
"babel": "5.8.23",
Expand Down
2 changes: 1 addition & 1 deletion src/components/DocExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class TypeDoc extends React.Component {
onClick={event => onClickField(field, type, event)}>
{field.name}
</a>
{argsDef && [ '(', <span>{argsDef}</span>, ')' ]}
{argsDef && [ '(', <span key="args">{argsDef}</span>, ')' ]}
{': '}
<TypeLink type={field.type} onClick={onClickType} />
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/ExecuteButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class ExecuteButton extends React.Component {
<ul className="execute-options">
{operations.map(operation =>
<li
key={operation.name ? operation.name.value : '*'}
className={operation === highlight && 'selected'}
onMouseOver={() => this.setState({ highlight: operation })}
onMouseOut={() => this.setState({ highlight: null })}
Expand Down
7 changes: 4 additions & 3 deletions src/components/GraphiQL.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ export class GraphiQL extends React.Component {
variables,
operationName,
response: props.response,
editorFlex: this._storageGet('editorFlex') || 1,
editorFlex: Number(this._storageGet('editorFlex')) || 1,
variableEditorOpen: Boolean(variables),
variableEditorHeight: this._storageGet('variableEditorHeight') || 200,
variableEditorHeight:
Number(this._storageGet('variableEditorHeight')) || 200,
docExplorerOpen: false,
docExplorerWidth: this._storageGet('docExplorerWidth') || 350,
docExplorerWidth: Number(this._storageGet('docExplorerWidth')) || 350,
isWaitingForResponse: false,
subscription: null,
...queryFacts
Expand Down

0 comments on commit d5f027a

Please sign in to comment.