6 ms·
I used Tamagui to build a number of screens for a new product we're working on, and I saw 90+ lighthouse scores on every page. The fact that I can get that, wit
by fernandorojo 4y ago
I used Tamagui to build a number of screens for a new product we're working on, and I saw 90+ lighthouse scores on every page. The fact that I can get that, with SSR support, inline styles, psuedo selectors, typed themes, and that it works on iOS and Android is novel.
I built the first library for React Native that supported Web/responsive design (Dripsy), so it's cool for me to see Tamagui taking this idea to the extreme.
- nickreese 4y agoI feel like I missing where data fetching logic/state management fits. Those seem mostly non-reusable?
- fernandorojo 4y agoWhat do you mean? Tamagui is only concerned with UI. Data and state management live in the react world using hooks.
- nickreese 4y agoHaha. Pardon the naivety. Have lived in the Svelte world too long. Hooks had just come out last time I used react. I’ll get to reading.
- fernandorojo 4y agoAh, makes sense. Tamagui basically solves the part of styling + rendering UI. It works on both web and native. As for logic/data fetching...this has gotten far, far better in React over the past few years. For data fetching, assuming you're using REST, @tanstack/react-query is incredible. It gives you a "hook" to wrap any async function, and returns loading states, errors, etc. In the past, people used Redux, but it's out of fashion now. I prefer a library called zustand whenever I need non-data related global state management.
- jsherrard 4y agoTamagui for "View" components and styling (+SSR on web) + React Query for data fetching, cache management, and neat hooks to use that data in apps. (+SSR on web + Zustand - "lite" state management on RN and React Web + Moti for X-Platform animations + Zeego for X-Platform menus = Ridiculously high percentage of code re-use across web and react-native apps. What a time to be alive!
- acemarke 4y agoI would definitely disagree with "Redux is out of fashion". Redux is still by far the most widely used state management lib with React apps, by a very large margin - my estimates are that 35-40% of React apps use Redux, and no other state management lib appears to be over 10% [0]. We also get a lot of very positive feedback on our modern Redux Toolkit package, which we designed to simplify Redux usage [1], and it includes our "RTK Query" data fetching and caching API as well [2], which is similar to React Query in use case and API. [0] https://blog.isquaredsoftware.com/2022/07/npm-package-market-share-estimates/ https://blog.isquaredsoftware.com/2022/07/npm-package-market... [1] https://redux.js.org/tutorials/essentials/part-2-app-structure https://redux.js.org/tutorials/essentials/part-2-app-structu... [2] https://redux-toolkit.js.org/rtk-query/overview https://redux-toolkit.js.org/rtk-query/overview
- gnomewrecker 4y agoMostly things that are very widely used in industry are indeed no longer “in fashion”. Instead they were in fashion and actually proved valuable enough to have staying power (as opposed to most fashionable things that are junk). Charitably, anyway — sometimes it seems you can’t tell why something is still widely used. Probably the mentioned hooks-based approaches are indeed fashionable now. Remains to be seen whether they’ll stick around.
- vages 4y agoMy team at work has completely rewritten from Redux with Redux Form to Tanstack query and React Hook Form over the past two years, and we don’t miss a single thing about Redux. We make an app that contacts lots of microservices in sequence and combines the data in many ways. Having automatic refetching, caching and the like by default makes a world of difference. This is not fashion. It’s quality.
- redbar0n 4y agoOn the contrary, data fetching and logic/state management is usually the most reusable. In any case they are independent of Tamagui itself.