How to refactor a multi-platform React app independently from the platform primitives?

11 Views Asked by At

I have developed a Vs Code extension, and used (almost) the same code in a different repository to build a Chrome extension that is identical for the end user.

Quite obviously this became hard to maintain and I refactored the code into one repo, but my code has now a lot of if else statements and this is obviously not ideal...

I am thinking of restructuring the code yet another time but this time in order to make it as much platform independent as I can (which is hard since I need a lot of platform specefic primitives in my places). In there a recommended tool / design pattern to make this properly ? Can you provide me with a react project that solves this same problem to learn more about this ?

I tried to refactor it while doing if else statements whenever I need a platform primitive

0

There are 0 best solutions below