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”

Simple tutorial to understand props vs state in React.js by @jjude

Simple tutorial to understand #props vs #state in #ReactJS - @jjude

  • Like parameters in functions, you can pass properties into react.js component.
  • If you want to understand the basics of React.js component, read Create React.js component with Typescript.
  • The property will be an input from the invoking component with the inital value for the Timer.
  • Let us see how to invoke this Timer component with an initial value.
  • Whenver a component calls , React.js calls its corresponding function.

Use props to send information to a component. Use state to manage information created and updated by a component.
Continue reading “Simple tutorial to understand props vs state in React.js by @jjude”

Open-sourcing our #Redux library to sync parts of store state with cookies: #javascript #reactjs #webdev #opensource

  • redux-cookies-middleware is a Redux middleware which watches for changes in Redux state & stores them in browser cookie.
  • Use dot-notation to specify the path of the subsets of the store that has to be synced with cookies.
  • Consider a store with the following shape as an example:

    To sync the auth and with cookies, pass the following object to the middleware:

    { session { name name of the cookie in which the value of session will be synced }, { name name of the cookie in which the value of auth.token will be synced } }

    Value of the path object is another object that takes more configuration options:

    An object of common options for the middleware.

  • It basically takes , reads the synced state from cookies and merges it with the initial state of your application.
  • ( , ( , ) { initialState { auth { token , key }, session }; read stored data in cookies and merge it with the initial state initialState (initialState, paths, ( , ) (req, name)); create store with data stored in cookies merged with the initial state ( reducer, initialState, ([ ( paths, { ( , ) (res, name, value) } ) ]) ); .

redux-cookies-middleware is a Redux middleware which syncs a subset of your Redux store state with cookies.
Continue reading “Open-sourcing our #Redux library to sync parts of store state with cookies: #javascript #reactjs #webdev #opensource”

Using Props in React – ziv zamechek – Medium

Using Props in React  #javascript #react #reactjs

  • In between the time it takes the first render of the component to fetching this data and setting it on our state that takes some time and during that time the length of videos is equal to 0 that is the reason that we see 0 for half a second when refreshing the page.
  • this.state = { videos: [] };When it is first rendered it does search of surfboards and it gets the response from this.stateApp is the parent of video list and video list need to get access to the videos that are in the app state.
  • passing data from the parent component App to the child component VideoList we are passing the list of videos just by defining a property on the JSX tag.Here we are passing video list to render method.
  • Anytime when App re render VideoList will get the videos as well.So now we have a functional VideoList component and it has array of videos to render.
  • Our video list component will receive props that contain an array of videos so we just loop over this array and for each video will generate one instance of video list for each item.Now each VideoListItem which is intended to show a single video now it will show a single li with a video.A map is a built in method that is a property of an array.

When we use functional component the props object will arrive as an argument to the function. const videos = props.videos; this is the array of videos. {props.videos.length} so this is saying that…
Continue reading “Using Props in React – ziv zamechek – Medium”

React is cool, deal with it – Medium

#React is cool, deal with it  #reactjs

  • We’re talking about three different files to fetch and display in a table in contrast to simply develop a “PropertyList” component and all related logic there.
  • If you were developing following MVC pattern you would first implement a Model which would represent the property and implement any related activity of API communication in that layer, add a route to a controller which would fetch the model and pass it to the view.
  • React is hard to learn, we’re all used to seeing javascript and html in different files, we’re all used to MVC and it lacks much functionality so you need to add some different things to handle routing, api calls, jsx support, etc..
  • Everybody knows how crazy javascript world has been lately releasing new tools faster than you can learn them, there’s one tool, React that markets itself as the V in MVC ( or at least it used to ) that slowly started to take over front-end development still i read about many people complaining with wrong arguments about why they don’t like it so i decided to talk about what is it that is so great about react.
  • With react you don’t write HTML, they implemented JSX which is a processor that lets you add xml style tags in javascript so instead of having a separate file for your scripts you write both the logic and the content in a single file.

Everybody knows how crazy javascript world has been lately releasing new tools faster than you can learn them, there’s one tool, React that…
Continue reading “React is cool, deal with it – Medium”

Testing React apps with Nightwatch

Testing #ReactJS apps E2E is simple with Nightwatch  - #developers #javascript

  • have the browser to open before all tests from this file, and then closed after the tests are finished they are finished
  • Now the before() hook will take care of login steps and the after() hook will close the browser when all tests from this file are done.
  • Since we have the command ready, we will want to use it in a test.
  • Once your test suite gets bigger, you’ll notice steps within your tests that could be abstracted away and reused across your project.
  • writing the test in Page Object Pattern methodology

Read the full article, click here.


@Syncano: “Testing #ReactJS apps E2E is simple with Nightwatch – #developers #javascript”


In this part of Testing React Apps with Nightwatch, I’ll talk about expanding your test framework with before() and after() hooks as well as custom commands


Testing React apps with Nightwatch