This repository has been archived by the owner on Jul 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
Uncaught ReferenceError: Component is not defined #27
Comments
no reply from author of this tool? |
It seems like a human error. Did you realize that you haven't export it? class ItemPage extends React.Component {
render(){
return <div>{this.props.value}</div>
}
} should be this? class ItemPage extends React.Component {
render(){
return <div>{this.props.value}</div>
}
}
export default ItemPage Anyway, it's a repository for php plugin that processes Javascript syntax (and it seems like it's getting rotten 😛). And anyway, try to ask on Stackoverflow first so you'll get answered more quickly, if you think it's a bug, feel free to create an issue. |
If you are using Rails, then possible cause of error is that you added |
you are missing the Component. import React, {Component} from 'react'; |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How can I use Browserify or webpack to compile a es6 script that works with reach-php-v8js? I have tried the following but it looks like the js string produced by
$rjs->getJS("app", "GLOB");
fails to access the component ItemPage inbuild.js
which isn't in the global scope.ReactDOM.render(React.createElement(ItemPage, {"value":"something"}), app);
item_page.js
After transpiling the es6 code into es5 with browserify, build.js by this command,
it ends up like this
Error in Chrome:
Html output
The text was updated successfully, but these errors were encountered: