« first day (3867 days earlier)      last day (1064 days later) » 

11:24 AM
I constantly wonder how many kittens are killed for me not following 1nf database design
Like.. Currently I have to store the order of columns in a table into a database. (The columns aren't one-to-one related to data though). I"m thinking about just storing them in a field with array data type and storing the column ids in the array (ordered).
Instead of making another table with like:
CREATE TABLE public_order(
    id serial NOT NULL,
    organisation int NOT NULL,
    column_id text NOT NULL,
    column_index int NOT NULL,
    PRIMARY KEY (id),
)
 
Anyone good with react-native?
https://codesandbox.io/s/morning-glitter-b8w5j?file=/src/App.js
When you click go to order after logging in, it loses the navigation state. I think it might be the loader that's not rendering the routes, or losing it somehow
 
11:42 AM
No experience with react-native but what do you mean with navigation state? You mean the screen won't update between home and order?
 
state was probably a bad description, but pretty much yeah
 
Are you sure it's losing the navigation state and not just trying to go to "/home/home/order" - appending the "order" to the screen path/state/whatever internals of navigator?
Actually if I change it a bit to
    <Stack.Navigator initialRouteName="Home">
      <Stack.Screen name="Home" component={OrderScreen} />
    </Stack.Navigator>
 
If you remove the setLoading(true/false); from getOrder inside the OrderProvider the navigation works fine
 
it doesn't seem to work anymore after logging in you are stuck at "loading...." so it seems that rather than not updating the state the orderscreen won't work?
 
All I can think is when it's doing the setLoading and the Routes component isn't returning any routes (just returning the loader) then it loses whatever was inside the navigation.navigate call
 
11:48 AM
hmm if I remove the useEffect from the order screen it also works. I think I know what happens...
the useEffect runs each time the component is rendered: however it causes getOrder to run, which updates the loading state of the OrderProvider. This in turn (react is dumb, doesn't do deep checks) makes the order screen to cause a redraw...
Which means useEffect runs again... Etc
And probably the navigator tries to be clever and chickens out
 
I thought useEffect only runs once after the component has been rendered?
Doesn't it essentially work in the same way as componentDidMount?
 
no that is if you add an (empty) dependency arrray to it
  useEffect(() => {
    getOrder(order_id);
  }, []);
It runs whenever anything in the dependency array is updated - or each after(!) each render when there's no dependency array.
 
ah right
removing useEffect didn't work for me
 
still not working though this is weird.
It doesn't?
It works for me?
I just commented out the getOrder() line
 
Yeah doesn't work, just redirects to home
oh right, yeah like I said removing the setLoader inside getOrder makes it work
 
12:01 PM
I see what you mean
 
Posted it on main, we'll see
0
Q: Navigating to other screens not working with programmatic routes

Ben FortuneI have a Routes component that returns Stack.Screen routes based on user state, or a loading screen depending on a loading state coming from a context. For some reason when calling navigation.nagivate to change screens, it just redirects back to whatever the initialRouteName was. I suspect it's b...

 
and I notice it happens due to the actual display of the loading screen
if you remove the loading screen display it works, but these are details of react-navigation that go beyond me
I havne't used that routing library, we use react-router instead
 
12:41 PM
@paul23 Thanks, got an answer that's pretty much the same as you said
 
 
1 hour later…
2:00 PM
Morning
 
2:56 PM
In a React app, if I have environment variables set in launch.json, how do I read them in the app?
 
3:16 PM
posted on May 18, 2021 by Cindy Bayless

The Stable channel is being updated to 90.0.4430.218 (Platform version: 13816.80.0) for most Chrome OS devices. This build contains a number of bug fixes and security updates. Systems will be receiving updates over the next several days. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels Find out how. You can su

 
 
4 hours later…
7:40 PM
posted on May 18, 2021 by Nicholas C. Zakas

Open source sustainability is a topic that is just starting to get the attention that it deserves. So much of the technology sector is run on software that can be used for free without any further obligation. However, as companies profit from using this software for free, the maintainers of the software often struggle to...

 

« first day (3867 days earlier)      last day (1064 days later) »