You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE After completely rebuilding the project because of facebook/react-native#4968 I am now unable to reproduce this error.
Working on a simple test app, I found that I was getting errors and was unable to import anything from the following file/module when it was named async.ts, but that everything worked fine when it was named async.tsx.
I prefer to distinguish between files with or without JSX by using the appropriate file extension. It's not a big deal to have all files be .tsx, but if that is required it should be noted in the README. Otherwise this project has worked great so far - thank you for putting it together.
// async.tsx// if something imported, fails if file is named async.ts// simple async functionsexportfunctiongetJSONResource(host: string,resourceName: string){returngetResource(host,resourceName).then(response=>response.json());}exportfunctiongetResource(host: string,resourceName: string){returnfetch(`${host}/${resourceName}`).then(handleErrors);}exportfunctionhandleErrors(response: Response){if(!response.ok){throwError(response.statusText);}returnresponse;}
1-2 sentences describing the problem you're having or the feature you'd like to request
Expected Behavior
I would have expected to be able to successfully import code from a file with a .ts extension, as long as no JSX syntax was used.
Observed Behavior
I was unable to import anything and received an error to that effect.
Environment
npm ls react-native-scripts-ts: v1.11.4
npm ls react-native: v0.52.0
npm ls expo: v25.0.0
node -v: 6.9.1
npm -v: 5.7.1
yarn --version: 0.27.5
watchman version: 4.9.0
Operating system: OS X Sierra 10.12.6
Phone/emulator/simulator & version: Both with Expo and iOS Simulator v10.0
The text was updated successfully, but these errors were encountered:
Description
NOTE After completely rebuilding the project because of facebook/react-native#4968 I am now unable to reproduce this error.
Working on a simple test app, I found that I was getting errors and was unable to import anything from the following file/module when it was named
async.ts
, but that everything worked fine when it was namedasync.tsx
.I prefer to distinguish between files with or without JSX by using the appropriate file extension. It's not a big deal to have all files be
.tsx
, but if that is required it should be noted in the README. Otherwise this project has worked great so far - thank you for putting it together.1-2 sentences describing the problem you're having or the feature you'd like to request
Expected Behavior
I would have expected to be able to successfully import code from a file with a
.ts
extension, as long as no JSX syntax was used.Observed Behavior
I was unable to import anything and received an error to that effect.
Environment
npm ls react-native-scripts-ts
: v1.11.4npm ls react-native
: v0.52.0npm ls expo
: v25.0.0node -v
: 6.9.1npm -v
: 5.7.1yarn --version
: 0.27.5watchman version
: 4.9.0Operating system: OS X Sierra 10.12.6
Phone/emulator/simulator & version: Both with Expo and iOS Simulator v10.0
The text was updated successfully, but these errors were encountered: