Matthieu G.'s Avatar

Matthieu G.

@matthieugc.bsky.social

Building mobile apps with React Native. Mistral AI / Le Chat

126 Followers  |  219 Following  |  16 Posts  |  Joined: 02.10.2023  |  1.9491

Latest posts by matthieugc.bsky.social on Bluesky

Thanks to @matthieugc.bsky.social and @cyrilbo.bsky.social for this edition while I'm taking a break

And of course @ricky.fm for the extra React team message and great newsletter shoutout πŸ€—

23.04.2025 20:57 β€” πŸ‘ 8    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

Awesome! You say it's compatible with old arch, but I guess the perf is not as good without sync layout?

23.04.2025 14:29 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
GitHub - matthieugicquel/device-shaper: JS/TS APIs to manipulate iOS and Android simulators JS/TS APIs to manipulate iOS and Android simulators - matthieugicquel/device-shaper

I might work on this lib to manipulate iOS/Android devices, add a few features, create an MCP server that uses it πŸ™‚

18.04.2025 11:34 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I'm wondering the same...
I guess the usual for caching: disk space usage, and stale results if the cache key is not good enough (if the length of the docs is any indication, it's probably good enough πŸ™‚https://ccache.dev/manual/4.10.2.html#_how_ccache_works)

12.02.2025 16:25 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

github.com/bluesky-soci... of course πŸ™‚

Also this french govt app: github.com/pass-culture...

06.01.2025 10:24 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0
Post image

This Week In React 213

Read/subscribe online:
thisweekinreact.com/newsletter/213

βš›οΈ
- React 19
- Next.js
- React Compiler
- React Router
- Restyle
- Lingui
πŸ“±
- State of RN
- Uniffi
- Shared Objects
- Fast IO
- Sheet Transitions
- Radon

11.12.2024 18:25 β€” πŸ‘ 74    πŸ” 16    πŸ’¬ 2    πŸ“Œ 1

Is this the "centering a div" of React Native? πŸ˜…

06.12.2024 14:59 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Screenshot - Some multiline text, followed by a "tag" that is not vertically aligned with the text

Screenshot - Some multiline text, followed by a "tag" that is not vertically aligned with the text

Has anyone found a clean way to vertically center a View inside a multiline text in React Native (with the new arch)?

An arbitrary `translateY` moves the tag, but it's very manual and not robust to font scaling 😬

06.12.2024 14:57 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 1

May I ask what extension/setting displays the inferred return type?

29.11.2024 18:53 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Code screenshot

import { Image } from "expo-image";
import { useStyles } from "react-native-unistyles";

import { icons } from "#assets/icons";
import type { Theme } from "#shared/theme/theme";

type IconName = keyof typeof icons;

type Props = {
  name: IconName;
  color: keyof Theme["colors"]; // There are 230 colors in the theme
};

export const Icon = ({ name, color }: Props) => {
  const { theme } = useStyles();

  return <Image source={icons[name]} tintColor={theme.colors[color]} />;
};

Code screenshot import { Image } from "expo-image"; import { useStyles } from "react-native-unistyles"; import { icons } from "#assets/icons"; import type { Theme } from "#shared/theme/theme"; type IconName = keyof typeof icons; type Props = { name: IconName; color: keyof Theme["colors"]; // There are 230 colors in the theme }; export const Icon = ({ name, color }: Props) => { const { theme } = useStyles(); return <Image source={icons[name]} tintColor={theme.colors[color]} />; };

Here's an example I found in the codebase I'm working on. How would you migrate it? πŸ€”

Of course there are other ways to do icons, but it's a legit approach...

(I simplified the code, there are other props like `size` in the real version)

29.11.2024 18:51 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It's good to get best-perf-by-default, but rerenders are ok sometimes. If they weren't we would be using jQuery not React πŸ˜….

I wonder how this will compose with reanimated (needing theme in animated styles) or some uses of react-native-svg.
I'll try to migrate and report back πŸ™‚

29.11.2024 17:33 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

What a great release πŸ˜€
The createUnistylesComponent api feels a bit awkward, have you thought about a useTheme hook? Maybe it’s not possible with the way things work on the C++ side?

29.11.2024 16:10 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Upgrading from 6.x | React Navigation React Navigation 7 focuses on streamlining the API to avoid patterns that can cause bugs. This means deprecating some of the legacy behavior kept for backward compatibility reasons.

Just got bit by the React Navigation v7 breaking changes after upgrading to Expo SDK 52. This is mentioned in the Expo changelog, but easy to miss (lots of changes πŸ˜€), so double check this part! It probably impacts every non-trivial app. reactnavigation.org/docs/upgradi...

26.11.2024 10:47 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

In React Native where navigating != (un)mounting, it can also happen just by navigating, can't it?
screenA (staleTime 1min) β†’ navigate to screenB (staleTime 10min) β†’ go back to screenA (it is still mounted) β†’ no refresh.

20.11.2024 13:11 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Or maybe always keeping the shortest timer instead of the most recent?

20.11.2024 12:55 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I see. This feels a bit like the code will be lying: if I get a bug report that a screen doesn't refresh, the code will say `staleTime: x` and I'll have to track down where the timer increase comes from across the codebase.
What about enforcing equal staleTime or at least warning about overrides?

20.11.2024 12:54 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

This looks like a great change (the persistence part is nice 😁), but I don't really get how you can have only 1 timer and 1 flag per query/queryKey, but different staleTimes for different screens? The more recently mounted screen will override the previous time, won't it?

20.11.2024 12:42 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Not that I know of, but here’s an example of a component that does it: github.com/infinitered/...

The new useImage hook in expo SDK 52 might help too :)

31.10.2024 16:43 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@matthieugc is following 20 prominent accounts