score:11
Accepted answer
the answer provided by @jason is close to what i needed.
in the end i ran this command
npx tsc --jsx preserve -t es2020 --outdir js --noemit false
this generated the .js
and .jsx
files in the js
folder which can be copied over to non-typescript systems.
--noemit false
is needed for the expo generated tsconfig.js which is noemit: true
the -t es2020
generates output using es2020 standards so you can get import
and export
along with the async
await
intact.
score:2
in the tsconfig.json file change "jsx": "react"
to "jsx": "preserve"
and then run tsc.
Source: stackoverflow.com
Related Query
- How do I convert TSX to JSX
- How to correctly convert jsx to tsx
- SVG in JSX - how to convert defs tag
- Convert const function code from JSX to TSX
- How to convert HTML to JSX (React.js)
- How to convert react JSX files to simple JavaScript file [offline transformation]
- How automatically compile jsx or tsx to js into visual studio code?
- How to convert string to JSX to using in React
- How to convert custom proptype in react jsx to typescript
- How to convert SVG style to JSX
- How can i convert a script tag that is defined as string to a JSX object?
- How do I convert my codes to correct jsx format?
- How do I convert html with jsx to jsx in React.js
- How do I use gulp to convert all jsx files to JavaScript?
- How to convert a string into JSX in React 17
- How can I convert JSX to JS without npm using a build script?
- How to replace href attribute value within JSX in tsx file?
- How to convert React JSX material ui elements to string
- Convert string to a jsx string in react | How to convert Unicode escape sequences to Unicode characters in react
- ReactJS convert HTML string to JSX
- How to repeat an element n times using JSX and Loadsh
- How can I return multiple lines JSX in another return statement in React?
- In JSX how do I set a className as string + {prop}
- How can I interpolate JSX with an expression in a string?
- How to comment JSX code out in .js files in VSCode?
- How to add custom html attributes in JSX
- How to concatenate two JSX fragment or variables or string and component (in Reactjs)?
- React.js: how to decouple jsx out of JavaScript
- How do I convert a string to jsx?
- In Sublime Text 3, how do you enable Emmet for JSX files?
More Query from same tag
- Using an if/else inside react render return
- Cannot find module 'babel-preset-react'
- Properly returning nested state with Object.assign
- Unexpected behavior in material ui popover
- Is it possible to add "Sub-Headers/Columns" to a Material Table Table in React?
- Using `expect.any(Object)` or `expect.anything()` does not work to match `undefined` in Jest
- React inline style with ternary
- Adding Redirects programmatically to React Router
- React Card Flip bug - Safari - Card not resizing as expected after flip
- Trigerring Axios calls after a day/week/month
- Fetching data using asynchronous function call in javascript does not work (doesn't follow the execution sequence)
- Child re-rendering because of function?
- How to render data horizontally in table ( react )?
- expect(...).toBeInTheDocument is not a function after setting up
- How to render countdown function with ReactJS
- Why are props being modified when clicking on a route?
- ReactJS ES6 Issue with import class
- How to test axios both success and failure case?
- How to store react component in state and pass a callback function
- How redirect to login page when got 401 error from ajax call in React-Router?
- Can CSS Grids be used in JSX Inline styles on Electron?
- React hidden input type file onChange not firing
- Overwrite styles of a component inside another in react
- ssr with react and express and requiring stats.json explanation
- issue installing npm package, react-circular-progressbar
- Inheritance of React.Component in TypeScript
- How to mock React stateless currying function using Jest & Enzyme
- Error while conditional rendering of state value using ternary operator inside jsx in Reactjs 18.0
- Pass react component inside dangerouslySetInnerHTML
- Why does new data to an async pipe not cause data to rerender?