This repository was archived by the owner on Sep 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 30
30
"react-addons-test-utils" : " ^0.14.3" ,
31
31
"react-dom" : " ^0.14.3" ,
32
32
"skatejs" : " ^0.14.3" ,
33
- "skatejs-build" : " ^4 .2.3 " ,
33
+ "skatejs-build" : " ^7 .2.0 " ,
34
34
"webcomponents.js" : " 0.7.22"
35
35
},
36
36
"peerDependencies" : {
37
- "react" : " >=0.14.0"
37
+ "react" : " >=0.14.0" ,
38
+ "react-dom" : " >=0.14.0"
38
39
},
39
40
"config" : {
40
41
"commitizen" : {
Original file line number Diff line number Diff line change 1
1
import assign from 'object-assign' ;
2
2
import pascalCase from 'pascal-case' ;
3
+ import React from 'react' ;
4
+ import ReactDOM from 'react-dom' ;
3
5
4
6
const defaults = {
5
- React : window . React ,
6
- ReactDOM : window . ReactDOM ,
7
+ React,
8
+ ReactDOM,
7
9
} ;
8
10
9
11
function syncEvent ( node , eventName , newEventHandler ) {
@@ -31,7 +33,7 @@ export default function (CustomElement, opts) {
31
33
const { React, ReactDOM } = opts ;
32
34
33
35
if ( ! React || ! ReactDOM ) {
34
- throw new Error ( 'React and ReactDOM must be globally available or passed via opts.' ) ;
36
+ throw new Error ( 'React and ReactDOM must be dependencies, globally on your `window` object or passed via opts.' ) ;
35
37
}
36
38
37
39
class ReactComponent extends React . Component {
Original file line number Diff line number Diff line change 1
1
import reactify from '../../src/index' ;
2
2
3
3
describe ( 'prop-types' , ( ) => {
4
- const msg = 'React and ReactDOM must be globally available or passed via opts.' ;
4
+ const msg = 'or passed via opts.' ;
5
5
6
6
it ( 'no react' , ( ) => {
7
7
expect ( ( ) => reactify ( document . registerElement ( 'x-errors-1' ) , { React : null } ) ) . to . throw ( msg ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ let x = 0;
6
6
function createComponentWithOpts ( opts ) {
7
7
return reactify ( document . registerElement ( `x-props-${ x ++ } ` , {
8
8
prototype : Object . create ( HTMLElement . prototype , opts ) ,
9
- } ) , { React , ReactDOM } ) ;
9
+ } ) ) ;
10
10
}
11
11
function createComponentWithProp ( name , done ) {
12
12
return createComponentWithOpts ( {
You can’t perform that action at this time.
0 commit comments