electron-with-create-react-app icon indicating copy to clipboard operation
electron-with-create-react-app copied to clipboard

Last package.json for ts.

Open bitrix1 opened this issue 5 years ago • 4 comments

{
  "name": "react-test",
  "version": "0.1.0",
  "private": true,
  "homepage": "./",
  "main": "src/electron-starter.js",
  "resolutions": {
    "@types/react": "^16.8.6"
  },
  "dependencies": {
    "electron": "^4.0.6",
    "react": "^16.8.3",
    "react-dom": "16.8.3"
  },
  "scripts": {
    "start": "react-scripts-ts start",
    "build": "react-scripts-ts build",
    "test": "react-scripts-ts test --env=jsdom",
    "eject": "react-scripts-ts eject",
    "electron": "electron ."
  },
  "devDependencies": {
    "@types/react-dom": "^16.8.2",
    "@types/electron": "^1.6.10",
    "@types/jest": "^24.0.9",
    "@types/node": "^11.10.4",
    "@types/react": "^16.8.6",
    "foreman": "^2.0.0",
    "react-scripts-ts": "3.1.0",
    "typescript": "^3.3.3333"
  }
}

bitrix1 avatar Mar 02 '19 20:03 bitrix1

Import window as any in App.tsx

const electron = (window as any).require('electron');
const fs = electron.remote.require('fs');
console.log('electron', electron);
const ipcRenderer = electron.ipcRenderer;

bitrix1 avatar Mar 02 '19 20:03 bitrix1

I have tried this, problem is that it removes Type information and TypeScript is now clueless.

gautamsi avatar Sep 05 '19 11:09 gautamsi

Unfortunately I have no experience with Typescript, so I can't offer a suggestion on how to get this working with it.

csepulv avatar Sep 05 '19 15:09 csepulv

this was for @bitrix1

gautamsi avatar Sep 05 '19 15:09 gautamsi