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",
}
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:
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
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