components icon indicating copy to clipboard operation
components copied to clipboard

Upgrade to React 17.0.x

Open jackcmeyer opened this issue 4 years ago • 8 comments

🚀 Feature Proposal

Upgrade components library to react 17.0.x

jackcmeyer avatar Dec 15 '20 22:12 jackcmeyer

@jackcmeyer could i take this one?

riiniii avatar Jan 15 '21 07:01 riiniii

Ok @riiniii

matteovivona avatar Jan 15 '21 08:01 matteovivona

@tehKapa is it ok to place this one on hold?

reason: need to wait for tsdx to support typescript version 4 for this reason: https://github.com/formium/tsdx/issues/926#issuecomment-723495537

error: config error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'.

but we need to use --jsx to 'react-jsx' for react 17, and their workaround in the thread does not work for me

riiniii avatar Jan 15 '21 14:01 riiniii

alternatively, maybe if we don't even want to introduce jsx transform, then i can just update react versions in package.json without any other additional changes

riiniii avatar Jan 15 '21 14:01 riiniii

@jackcmeyer @blestab any clue?

matteovivona avatar Jan 16 '21 19:01 matteovivona

error: config error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'.

Thanks @riiniii For the quoted error above, may you see if suggestions from this SO thread might work for you (assuming you have not already come across it)? https://stackoverflow.com/questions/50432556/cannot-use-jsx-unless-the-jsx-flag-is-provided

blestab avatar Jan 18 '21 08:01 blestab

error: config error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'.

Thanks @riiniii For the quoted error above, may you see if suggestions from this SO thread might work for you (assuming you have not already come across it)? https://stackoverflow.com/questions/50432556/cannot-use-jsx-unless-the-jsx-flag-is-provided

hi @blestab, thank u for the suggestion. i tried that, but realized that I couldnt use 'preserve', 'react-native', or 'react' with typescript + react 17 transform.

my findings were that for JSX Tranform and typescript to work together, tsconfig.compilerOptions.jsx needs to be 'react-jsx' or 'react-jsxdev'

so generally everything passes until i run npm run build (tsdx build), which gives me this error to say my tsconfig options are not correct: Screen Shot 2021-01-24 at 9 59 19 PM

if we do not decide to implement jsx transform, i can still update to react v17, and keep typescript version + tsconfig.compilerOptions.jsx = 'react', and things can pass that way. just that we will not support jsx transform yet. thoughts?

riiniii avatar Jan 24 '21 14:01 riiniii

this thread on how CRA implements React 17 + JSX Transform summarizes my findings / changes well https://gist.github.com/iansu/4fab7a9bfa5fa6ebc87a908c62f5340b

riiniii avatar Jan 24 '21 14:01 riiniii