Skip to content

ES6 class component declaration #110

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

Closed
xabikos opened this issue Apr 5, 2015 · 9 comments
Closed

ES6 class component declaration #110

xabikos opened this issue Apr 5, 2015 · 9 comments

Comments

@xabikos
Copy link
Contributor

xabikos commented Apr 5, 2015

According to documentation we can use the ES6 class syntax to declare components. I tried to do so but I am getting an error when the page is rendered server side.

My simple component looks like this

class App extends React.Component {
  render() {
    return <p>
        Hello World!
      </p>;
  }
}

But I am getting the error below:

Error while loading "~/Components/app.jsx": TypeError: Cannot read property 'prototype' of undefined
   at Script Document [6]:6:241 -> ];}}var ____SuperProtoOf____Class0=____Class0===null?null:____Class0.prototype

I have enabled the corresponding setting in react configuration (UseHarmony)

Is it possible to use this syntax today or am I missing something? I could create a small demo application to demonstrate this.

@Daniel15
Copy link
Member

Daniel15 commented Apr 5, 2015

This is because ReactJS.NET isn't using the latest version of React. I'll
update it soon.

Sent from my mobile.
On Apr 5, 2015 3:13 AM, "Charalampos Karypidis" [email protected]
wrote:

According to documentation we can use the ES6 class syntax to declare
components. I tried to do so but I am getting an error when the page is
rendered server side.

My simple component looks like this

class App extends React.Component {
render() {
return


Hello World!

;
}
}

But I am getting the error below:

Error while loading "~/Components/app.jsx": TypeError: Cannot read property 'prototype' of undefined
at Script Document [6]:6:241 -> ];}}var ____SuperProtoOf____Class0=____Class0===null?null:____Class0.prototype

I have enabled the corresponding setting in react configuration
(UseHarmony)

Is it possible to use this syntax today or am I missing something? I could
create a small demo application to demonstrate this.

Reply to this email directly or view it on GitHub
#110.

@xabikos
Copy link
Contributor Author

xabikos commented Apr 5, 2015

Thanks for the quick response @Daniel15 I will keep an eye on it

@Daniel15
Copy link
Member

The upgrade will be covered by #93. Closing this out.

@Daniel15
Copy link
Member

Just tested after upgrading React to 0.13.1 and it works now. If you want to use it before I release a new version, you can get a ReactJS.NET build off the build server shortly, or just build it yourself. Instructions are on the site. Thanks for reporting!

@xabikos
Copy link
Contributor Author

xabikos commented Apr 13, 2015

Thanks for the update @Daniel15

@xabikos
Copy link
Contributor Author

xabikos commented Apr 13, 2015

Have you any idea when you will upgrade nuget package too?

@Daniel15
Copy link
Member

New release will be some time in the next few days, I just need to do more
testing and see if there's any other bug fixes that I should do for this
release. In the meantime you can get packages off the development server,
or build it yourself and use the resulting NuGet packages. Instructions for
both are on the site.

Sent from my mobile.
On Apr 13, 2015 1:45 AM, "Charalampos Karypidis" [email protected]
wrote:

Have you any idea when you will upgrade nuget package too?

Reply to this email directly or view it on GitHub
#110 (comment).

@Daniel15
Copy link
Member

I'm just pushing the updated NuGet packages now, they should be up in a few minutes.

@xabikos
Copy link
Contributor Author

xabikos commented Apr 14, 2015

Thank you so much for the update. It's right on time. I want to incorporate the webpack with ES6 style syntax for our project.

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

No branches or pull requests

2 participants