ComponentDoesWhat? React Native Cheat Sheets – Erin Fox – Medium

  • React Native Cheat SheetsBefore I started my job at Major League Soccer, I only had one week of React training.
  • Great news when I was about to join a team of React engineers to rebuild their mobile app in React Native, right?Over 6 months have gone by now and I have learned SO MUCH, it’s crazy.
  • (oh, but ++ because it’s build in React)Flex of Dror BiranThere’s been days when I wanted to pull my hair out because my flex style properties weren’t working the way I wanted them too.
  • Even the zombies help.SVG feel like an SVG queen whenever I use this handy conversion site.Easing only is it really fun to hover over all of these functions to see their animations, it’s really helpful.Images (when you have spend way to much time trying to find placeholder photos.
  • Command r. Command much (almost) everything you need to get started with GraphQL is here.

Before I started my job at Major League Soccer, I only had one week of React training. Great news when I was about to join a team of React engineers to rebuild their mobile app in React Native…
Continue reading “ComponentDoesWhat? React Native Cheat Sheets – Erin Fox – Medium”

Redux Devtools for Dummies – tyler clark – Medium

Redux Devtools for Dummies  #react #development #testing #redux #javascript #reactjs

  • In my opinion, this is the most robust and easiest to set up.npm install –save redux-devtools-extensionimport { composeWithDevTools } from ‘redux-devtools-extension’; into the store file.Finally compose your store with the imported module:import { composeWithDevTools } from store = createStore(reducer, composeWithDevTools( // other store enhancers if any));I recommend using this option over the others because it helps avoid issues with isomorphic applications.
  • Check out the additional features you can add and remove to the console hereHere is how one would add in those customized features:import { composeWithDevTools } from composeEnhancers = composeWithDevTools({ // Specify custom devTools options});const store = createStore(reducer, /* preloadedState, */ composeEnhancers( // other store enhancers if any));Also, if you do not have enhancers/middleware in your application, there is a more straight forward approach:import { devToolsEnhancer } from store = createStore(reducer, /* preloadedState, */ devToolsEnhancer( // Specify custom devTools options));Notice that we are using devToolsEnhancer here rather than composerWithDevTools.
  • If you installed everything correctly in your store initialization, it will show you something like this:If there is an error in your set-up, including exceptions thrown from your code, you will see this:Let’s break down whats happening in each section of the dev tools.Left-Side Console ToolsThe left hand column of the dash is showing in real time the actions that are firing on the current page (as defined by the action creator types).
  • The skip will cross out the action and show you your app without that action.Right-Side Console ToolsThe four tabs at the top right are in my opinion the most helpful of the tools.DiffThe right side of the console has multiple options to see the state of the application and the relation of each action to the state.When an action is selected in the left hand side of the console, the Diff option will show only what that individual action changed in the state tree.ActionClicking on the Action tab will show the individual action type and any data it is carrying along to the reducers.In the example above, this action has a type features/FETCH_SUCCESS and also carries data, the requested features to the reducer.
  • Including all of the combined reducers and their corresponding data branches.The Raw tab shows the action creator in a code view.StateThe state tab shows the entire state tree at the time of the action selected in the left hand side of the console.TestBack to the upper tabs, there is a test option.

Do you take one look at the docs and just give up? Did you know that you can completely control the currently running application’s actions/state through these tools? The first step is the easiest to…
Continue reading “Redux Devtools for Dummies – tyler clark – Medium”

Getting eslint right in React Native — Medium

Getting #eslint right in #ReactNative, good insights by @machadogj 💡 #javascript #react

  • In order to use eslint you don’t need a .babelrc file because React Native already provides a default preset, but If you want to customize the babel rules with your own .babelrc file, you can use the package babel-preset-react-native .
  • The reason for needing babel-eslint is that the default parser used by eslint (espree) does not support static properties .
  • { “parser”: “babel-eslint”, “plugins”: [ “react” ], “extends”: [ “eslint:recommended”, “plugin:react/recommended” ], “rules”: { // overrides } }
  • no-unused-styles: Detect StyleSheet rules which are not used in your React components split-platform-components: Enforce using platform specific filenames when necessary no-inline-styles: Detect JSX components with inline styles that contain literal values no-color-literals: Detect StyleSheet rules and inline styles containing color literals instead of variables
  • Getting eslint right in React Native

Read the full article, click here.

@OpenCoconut: “Getting #eslint right in #ReactNative, good insights by @machadogj 💡 #javascript #react”

Eslint is not new for React Native apps, but I admit that getting eslint to work seamlessly in React Native is not so trivial (yet?) and…

Getting eslint right in React Native — Medium