Sp-dev-docs: React types using an old version in SPFx 1.8.0

Created on 14 Mar 2019  路  10Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

@patmill in the latest version of SPFx, the version of React got bumped to 16.7 which is a great thing, but the types are still referencing the same version as in 1.7.0 and 1.7.1: "@types/react": "16.4.2". Due to this, you are not able to use any of the new features in React version 16.7.

spfx-general fixed tracked bug-confirmed

Most helpful comment

We are working on the updated setup of default scaffolding which will use the right React, Office UI Fabric and TypeScript combination. Right now the right version matrix is not properly yet documented and we are also working on that setup if you want to use for example later version of the React as that has then dependencies on TypeScript and OUIFR... more details soon.

All 10 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

OK, thanks. We can certainly bump that and push an update. Is there any issue when you manually bump the version and re-install/rebuild?

@patmill check: https://www.eliostruyf.com/using-the-full-potential-of-react-in-sharepoint-framework-1-8-0/

In order to manually bump the types version, the TypeScript version also needs to be updated to version 3.2.

When you go down that rabbit hole, what version of OUIFR do you use? (or do you?)

The same version that is part of SPFx, so in this case it will be 6.143.0. Although I have not yet tested it.

We are working on the updated setup of default scaffolding which will use the right React, Office UI Fabric and TypeScript combination. Right now the right version matrix is not properly yet documented and we are also working on that setup if you want to use for example later version of the React as that has then dependencies on TypeScript and OUIFR... more details soon.

@patmill I noticed that in a freshly generated SPFx project (1.8.1 but also earlier versions) types/react and types/react-dom are listed under the dependencies section in package.json (instead of devDependencies which at first sight would seem to be more appropriate). In his article about SPFx 1.8 @andrewconnell also installed a newer version of types/react under the devDependencies key. Is there a specific reason to use the dependencies section?

@ronaldborman it's an issue they've acknowledged... just not high on the priority: https://github.com/SharePoint/sp-dev-docs/issues/2249

As of 1.10, this issue doesn't repro. @estruyf can you verify whether or not this issue still occurs?

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonthenerd picture jonthenerd  路  3Comments

ken-harris picture ken-harris  路  3Comments

jonthenerd picture jonthenerd  路  3Comments

StfBauer picture StfBauer  路  3Comments

patrick-rodgers picture patrick-rodgers  路  3Comments