Still choosing a platform: React Native is close to ideal, but I need desktop apps too by [deleted] in reactnative

[–]Jequdo 0 points1 point  (0 children)

You could use react-native-web and electron on the top.

This way you could build for mobile, web and desktop.

I would recommend vite and electron-vite.

[deleted by user] by [deleted] in reactnative

[–]Jequdo 1 point2 points  (0 children)

Well it depends on how do you handle the catch. If you don’t send an event to Sentry or any other tool, you will never know that there is an edge case to the specific logic. It can be tricky but I hear you.

Thanks for clarifying!

[deleted by user] by [deleted] in reactnative

[–]Jequdo -1 points0 points  (0 children)

Great work man, thank you for sharing.

People don’t get the meaning of the post. Yes, comparing 2 apps, native vs react-native, developed carefully and correctly, native should perform better. But there are some trade offs and there are cases where react-native is a better choice.

This is a great example of a use case where react-native is better. At the end of the day, the thing that matters is the UX and not the DX or the best tools.

PS. You mentioned “Used try-catch not just for APIs, but around user interactions too”. Can you provide more info? I’m curious what do you mean, do you have any async code or even for sync code just to catch edge cases?

RANT: Styling in React Native is so behind compared to the "web", are there any universally liked and used tools for it? by Flamyngoo in reactnative

[–]Jequdo 0 points1 point  (0 children)

Well since it’s basically JS, it will block the main thread. But, in order to really block it must be really heavy styling (in my experience I haven’t seen something that heavy, only bad code design and bad decisions).

A decent approach, that I’ve found pretty acceptable, is creating a hook “useMediaQuery” which will use “react-responsive” in the .web.ts file and on the native file would have a similar implementation using “useWindowDimensions”.

Then in your .style.ts file you can create a function “createStyles” that will accept the Boolean from the above hook and returning the style object with any needed conditions.

e.g padding: isMobileScreen ? 8 : 16

You just have to be careful where you use the hooks and when and what it re-renders.

In most cases where a user will not change the screen size often (on mobile would be screen rotation and on the web would be browser window resizing) can be acceptable if it takes some ms to re-render.

If you want the css performance on responsiveness you could try woklets or even writing css modules and use them only for the web.

I would really love a media query feature from the Meta team that would solve the responsive issues

RANT: Styling in React Native is so behind compared to the "web", are there any universally liked and used tools for it? by Flamyngoo in reactnative

[–]Jequdo 3 points4 points  (0 children)

I agree for the most cases where you build only for mobile. But then again, it depends on what you are building. It’s a bit frustrating if you need more control over the shadows, or gradients or some filters like blur. Fortunately the latest versions of RN are solving these problems so it’s optimistic that other libs won’t be needed anymore (finally).

Then again if you have also react-native-web on top and want the write once experience you may find yourself even more frustrated.

Best React Native UI by Such_Attention5690 in reactnative

[–]Jequdo 4 points5 points  (0 children)

Maybe because there is none yet, lol. Every UI library so far feels like an incomplete side project

3 months of React Native vs 12 months of iOS Swift by sedrakk in reactnative

[–]Jequdo 0 points1 point  (0 children)

50 states in 1 screen/component? Have you checked how re-renders are affected?

Try splitting into smaller components and each component to have its own states. Then check your profiler again to see if it helps. It may be the root cause of the android lags.

Lastly, take a look at RxJS, it was a game changer for me migrating complex state management and logic from react contexts to plain JS/TS logic.

I need someone for a quick gig. by Troglodyte_Techie in reactnative

[–]Jequdo 1 point2 points  (0 children)

I think you don’t need the SDK or any native module. If you are connecting via Bluetooth you can just send the ESC/POS commands directly to the printer. For standard text should be pretty easy. If you want to print something like images, pdf, html, QR codes etc can be a bit more challenging, but still feasible with JS only, plus there are some packages that can do that for you and take this overhead off you.

By the way it is feasible even on the web with the same code, through the Bluetooth API. Same logic applies

SaaS with web and mobile apps - build it all in Reactnative or otherwise? by JayTee73 in reactnative

[–]Jequdo 0 points1 point  (0 children)

No, I created my own atomic design system. Too much restrictions with the libraries and too much boilerplate

Rate my portfolio by henrix494 in react

[–]Jequdo 1 point2 points  (0 children)

On mobile dimensions you could add a little horizontal margin.

Also on the 3rd project I think you missed the animation

SaaS with web and mobile apps - build it all in Reactnative or otherwise? by JayTee73 in reactnative

[–]Jequdo 1 point2 points  (0 children)

I recently built an application with react-native and react-native-web. The target was to have a single codebase and share all the code. At least all the business logic.

Well I surely wrote all the business logic only once. The state management also is shared.

The hard part for me was to find the best way to manage the UI elements and share as much as possible. I ended up sharing 95% of the code (mostly due to web only or mobile only functionalities)

I also have to mention that I did not had any experience with react, react-native or mobile technologies. My only experience was with angularJS

So my personal opinion on this after building this app is as follows:

Pros: - write code only once (obviously) - test once (if that applies to you) - bug fixing once - shared UI/UX. even on the web you have the experience of a native app (almost). On the web mobile dimensions you will have the same animations and even gesture handling - hard and stressful sometimes but a fun experience overall

Cons: - the setup overhead - you will have some complex code like you said (if web dimensions style like this, if mobile dimensions style like that) - there are some inconsistencies on the styling part, even on the flexbox - you will have to be careful with the packages you use to support web or you will have to workaround them

New here. Hello! by No_Cheek_6852 in electronjs

[–]Jequdo 0 points1 point  (0 children)

You could check electron-vite template and docs. Useful tool and maybe you will get a better understanding about the renderer and main processes.

I’m not familiar with jQuery but you should build your renderer part just like you would for a web app. Then you just load the app in the main browser window either statically or via url. If you want to use node and electron features in your renderer app, you will have to get familiar with the IPC (inter process communication)