Serenity 3.6.0 Upgrade Guide

Created on 4 Apr 2018  路  10Comments  路  Source: serenity-is/Serenity

Serenity 3.6.0 comes with React integration but it is currently activated in StartSharp only. Anyway, once you upgrade to Serenity 3.6.0, you may get some errors about React, as Serenity.CoreLib has references to it.

Serenity doesn't require React, it is just a TypeScript warning, so, you don't actually need to include React scripts in your site

To resolve such errors, you'll need to include typing for React in your package.json:

  "dependencies": {
    //...
    "@types/react": "^16.1.0",
  }
notice

Most helpful comment

React will be replacing Vue actually, this post has more info on that:

http://serenity.is/blog/2018/04/03/hello-react-email-client

All 10 comments

Thanks @volkanceylan :)

@volkanceylan is the React going to be replacing jQuery in frontend interactions?

No, not yet, they'll be working together for now

React will be replacing Vue actually, this post has more info on that:

http://serenity.is/blog/2018/04/03/hello-react-email-client

Thank you!

Question here, i have integrated 3.6.0 with react and i am using CardViewMixin.
It works but i still always have warnings (i have react listed in packages.json)

warning TS2304: Cannot find name 'React'.
warning TS4020: 'extends' clause of exported class 'xxxxCard' has or is using private name 'React'.

I have created another Startsharp dummy project but dont have those warnings.

Is there something (trick) i did miss ?

did u do this?
"dependencies": {
//...
"@types/react": "^16.1.0",
}

add dependancy to package.json as Volkan said?

yes i did this. Application is working with React activated and i did a file compare of allmost all files from startsharp.

Found this but with no luck.

https://www.garysieling.com/blog/fixing-typescript-error-error-ts2304-cannot-find-name-react

Also set the :

<add key="ScriptBundling" value="{ Enabled: false, Minimize: true, UseMinJS: true, NoMinimize: ['~/Scripts/ckeditor/ckeditor.js'], Replacements: { REACT: 'development' } }" />

Closing this, @kilroyFR if you are still having this issue, please try updating Visual Studio and TypeScript. Especially VS 2015 might have such issues.

Regarding the all-too-common "has or is using private name" error, I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. https://github.com/microsoft/TypeScript/issues/35822

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahsansolution picture ahsansolution  路  3Comments

stepankurdylo picture stepankurdylo  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

Akarsh03 picture Akarsh03  路  3Comments

dudeman972 picture dudeman972  路  3Comments