#Best way to create a React App?

8 messages · Page 1 of 1 (latest)

jolly quiver
#

I'm trying to create a React app using Electron, React, Webpack, and Typescript. I made my project using Electron Forge, but I am struggling to get the behavior I want. I was just curious if this is the way most people go about creating such a project or if there are alternatives you prefer?

fast cloud
#

An alternative is to create a project with CRA and then add Electron and Forge. But what problem are you struggling with?

tough cape
#

@jolly quiver what exact behaviour are you struggling with? I'm interested in finding out!

jolly quiver
#

I think I've started to get going in the right track @tough cape @fast cloud. I think as opposed to a traditional setup, having to work through the renderer + files made it a bit confusing and the docs I could find online didn't quite explain it or they used CRA. But I figured out that I just need a single file to act as the "main" react component and adding everything into that similar to a traditional app, where as before I thought i was supposed to add it all to the renderer lol..

tough cape
#

Ah yeah, app architecture for React doesn't really change AFAIK 😄

jolly quiver
#

2 quick q's I have while the thread is open are 1) Do you only have 1 renderer file for your entire app & 2) is it possible to wait for the app to load fully before injecting components so I don't need to display a "loading" html page?

tough cape
#
  1. You usually have a single entry point file unless you need multiple renderer processes (e.g. overlay window, child window, etc.)
  2. Not that I'm aware of, but I think you would want to look in the React ecosystem for that (i.e. not really electron-specific topics)
#

any react components, utility functions in ur react app, etc. are technically running in the renderer process as well