A tiny ~700b centralized state container with component bindings for Preact. #reactjs #preact

  • { , , } store ({ count }) If actions is a function, it gets passed the store: ({ ( ) { { count . } }
  • , The above example as an Arrow Function: ({ count }) ({ count count }), ( ) { res ( ) { stuff .
  • , ) } }) ( , actions)( ({ count, increment }) ( div p Count {count} p button onClick {increment} Increment button div ) ) () ( Provider store {store} App Provider ) – – Creates a new store, which is a tiny evented state container.
  • Register a listener function to be called whenever state is changed.
  • If don’t, just open a new clear and descriptive issue.

unistore – 🌶 700b state container with component actions for Preact
Continue reading “A tiny ~700b centralized state container with component bindings for Preact.
#reactjs #preact”

Expo SDK v16.0.0 is now available – Exposition

Expo SDK v16.0.0 is now available  #react #reactnative #expo #reactjs

  • This release includes a lot of improvements so I’ll just get to it.Improvements to iOS Developer Tools in ExpoWe move away from the two-finger gesture to the standard React Native “rage shake” — you can use the old gesture by going to the Profile tab in Expo, then options.The Developer Menu and Expo Menu have been combined into one.Read more about this in the full post “Improvements to iOS Developer Tools in Expo”This opens the door for more improvements in the future, we’re really looking forward to it!React 16 alpha and peerDependenciesReact Native 0.43 depends on React 16 alpha.
  • Just give it an array of the keys your app cares about and it will copy their values from the old to the new store:import { LegacyAsyncStorage } from ‘expo’;// Before we read from or write to AsyncStorage, migrate them// Make sure this is inside of an async functionawait ‘item1’, ‘item2’, ‘item3’,]);If any of the items already have a value in the new store it will skip them so that it doesn’t overwrite new data.
  • Try it out in Native Component List, and read the API reference.ErrorRecoveryIf your app crashes in production with a fatal JS error, Expo will restart the app for you.
  • Respect orientation configuration correctly on iPads.Fix an issue with Universal Clipboard on iOS bothering you with alerts while using an Expo project.Add options screen on the profile tab on iOS, to pick which gesture you prefer to use to open the Expo Menu.Breaking changes in SDK v16.0.0If you use AsyncStorage on iOS you need to follow the steps described under “BREAKING: Scoped AsyncStorage on iOS” earlier in this document.Breaking changes in expo- validates options more strictly.
  • If you use this, read more in this commit.Upgrading your app to Expo SDK v16.0.0 from v15.0.0Close XDE or your exp CLI serverIn exp.json, change sdkVersion to “16.0.0”In package.json:- change react-native version to change expo version to “^16.0.0”- change react version to “16.0.0-alpha.6”- change @expo/ex-navigation version to “~2.10.0” (if you use it)- change jest-expo version to “~0.4.0” (if you use it)- delete your project’s node_modules directory and run npm installagain (or use yarn, we love yarn)Re-open XDE or exp and start your project once npm install from the previous step has completed.Update the Expo app on your phones from the App Store / Play Store.

Expo SDK 16.0.0 is based on the recently released React Native
0.43, “March”. This is a jump of 1 version of React Native; Expo
SDK 15.0.0 was based off of 0.42, “February”. React Native 0.43 depends…
Continue reading “Expo SDK v16.0.0 is now available – Exposition”