npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-gev

v0.58.4

Published

The smartest UI/DX kit for React Native!

Downloads

14

Readme

npm TypeScript PRs Welcome npm

react-native-gev

This package is on development. This readme is a raw draft.

While it's already great, useful and being used on prod on two apps, constant breaking changes are still being made to achieve the best DX. I will keep making it more mature to avoid having legacy systems.

There are great known components libs like React Native Elements, React Native Paper... but there are always aspects on them that makes me not think they don't exactly fit my use cases.

This both improves some React Natives components like View and add many other useful components. They are all easily customizable and fast to catch up on how to use it.

Along components, this package adds some very useful, simple and intuitive shortcuts to usual components.

This is opinionated and it's being conceptualized and developed for a long time. This provides a way greater productivity and joy during development.

  • Why we write hundreds of styles in Views when we can only type a single s? This is really quick to catch up and improves readability and productivity when we are talking about months of work.

  • Why to have a <Text>My Text</Text> when we can have only <Text t='My Text'/>?

It also adds some common components:

  • A powerful TextInput, with great ready to use integration to react-hook-form. Has some very useful presets for common data input.
  • A really beautiful, validated and customizable List component with react-navigation integration, allowing simple navigation with a onPressNav: (n) => n('Profile'). It automatically adds a chevron when this is set! Also has a very useful switch property, to use our Switch!
  • A Switch that also ready to be used with react-hook-form and integrated debounce functionality for sync and async callbacks.
  • A ready to use Button that sets a fullscreen loading if the onPress returns a Promise. It also will sets Alert.alert() with the reject message.

Themeing:

  • RefreshControl uses the primary color. There is also a convenient FlatList that uses this RefreshControl.
  • [To be written]

Installation

expo install react-native-gev react-hook-form react-native-safe-area-context expo-status-bar react-native-reanimated @react-navigation/native @expo/vector-icons

react-native-safe-area-context and expo-status-bar for StatusBar

react-native-reanimated for TextInputOutline

@react-navigation/native for useFocusEffect hook

@expo/vector-icons for icons

Best practices

Over the time I developed my own practices that aims to improve my DX. And they do!

  • When defining a StyleSheet, call it s instead of calling it styles. Less useless letters, better readability and faster typing.
  <View s={s.container}/>
  ...
  const s = StyleSheet.create({...})
  • When using our <Text/>, have t (text) as the last property, and s (style) before it. Faster to find out the text in this way.
  <Text anyOtherProp s={s.text} t='Hi, Earth!'/>

Powered by:

Alternatives

  • react-native-paper - Some components here such as Snackbar were built on top of it! It's a popular package but I just don't like most of it.
  • react-native-elements - I have used it a bit on the past. The List for example was a wrapper to their List, but it had so many customizations and limitations that I decided to made my own. It's also a good package but don't satisfy my needs.
  • Tailwind - While Tailwind is useful, it just isn't typesafe and Intellisense'able. I don't like how its styling is done.

Info

  • The /src is shipped with the package. This ensures the access to the source code.
  • Some patterns and components were based / built on top of others libs, so we have the best practices. When they do, they have their source properly linked, with all the respect to the authors and to their licenses. This aims to improve them and make them fit better this project.
  • We use Portals instead of native Modals. Modals have a good amount of issues and limitations. However, our mFunctions like mSnackbar etc have the m for Modal instead of p for Portal as pSnackbar wouldn't look too good.
  • When the component has properties that changes the component's style, they have priority over the styles property, to allow individual customization.
  • We use MaterialCommunityIcons as the default icons family. For Button's leftIcon property, for example, we can pass 'email' to use the corresponding MaterialCommunityIcons icon.

TODO

  • i18n maybe in Provider or via global state: {currency: 'R$', decimalSeparator: ','}

Usage

Changelog