BearStudio / start-ui-native

πŸš€ Start UI [native] is an opinionated UI starter with βš›οΈ React Native, 🌿 Ficus UI, βš›οΈ Zodios & 🐜 Formiz β€” From the 🐻 BearStudio Team
MIT License
141 stars 16 forks source link

Find a way to be able to change config in real time #47

Closed qlereboursBS closed 1 year ago

qlereboursBS commented 3 years ago

Description

Currently, when I edit the local config and run a yarn set:env:local, it breaks (using Android at least), saying that:

error: Error: Unable to resolve module ../../../environment/config from /home/qlerebours/Projects/StartUI/start-ui-native/src/screens/Dev/About/index.js: 

None of these files exist:
  * src/environment/config(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * src/environment/config/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
> 1 | import React from 'react';
  2 | 
  3 | import { useNavigation } from '@react-navigation/core';
  4 | import {]

Then another bug occurs if I change the API_URL in the src/environement/config.js file: Cannot read property baseUrl of undefined.

Steps to reproduce (the second bug)

laogui commented 2 years ago

environments/local is empty. run yarn set:env:dev

qlereboursBS commented 2 years ago

Hello @laogui thanks for your help In fact, I already run the commands in the README.md that allows to copy what's in the dev config file into the local config file, so the local config file isn't empty What I'm saying with this issue, is that when you edit the config file, it won't be taken into account and will crash the app, you'll have to re-run the project. I want to find a way to make it dynamic, so that we can edit the config without having to start the project again :)