React Native + Vue.js = React-Vue () This is so awesome! #react #vuejs

  • React-Vue is designed to connect React and Vue.
  • Thanks to Vue’s clear hierarchical design, we can easily pull out the reactivity system (9 KB gzipped), and drive React component rendering.
  • Introduce react-vue-loader, which compile the Vue component into a React component.
  • As you might think, your previously written Vue components can run inside the React component, and your React components can also run inside the Vue component.
  • All React Native Components exists as built-in components in Vue, you can use react native components as following

    The similar JSX code is as follows

react-vue – Run Vue in React and React Native
Continue reading “React Native + Vue.js = React-Vue () This is so awesome! #react #vuejs”

React Behavioral Wrapper Components – Ian Carlson – Medium

React Behavioral Wrapper Components  #ui #react #javascript #reactjs

  • But because of how flexible React is you can create wrapper components that add behavior to the children being passed through.
  • This is more applicable when using Redux since not all the backend requests are made within the same component, like a session container for example.Here’s a example of creating an opacity animation component that adds the animation to any child component.
  • This is based on the example in the React documentation using the CSS transition group extension to apply fade-in, fade-out animations based on the lifecycle of the child component(s).
  • The former is actual animation time and the latter is how long temporary classes will stay in existence.Here’s an example of how to use the OpacityAnimation:You can also pass an array of children as well, but it’s important to carefully manage the key properties on each child — even for just one child.
  • For example, a tooltip component would display the children as is, but then attach event handlers to display the tooltip on the right conditions.

Another great thing about React is how easy it is to add behavior to components through composition. Typically new people only think of composition in terms of layout. But because of how flexible…
Continue reading “React Behavioral Wrapper Components – Ian Carlson – Medium”

React Native Pitfalls – Anton Kulyk – Medium

React Native Pitfalls  #reactnative #react #reactjs #reactjs

  • React Native PitfallsThere are a lot of collections of anti-patterns for React and different app’s state managers like Redux and MobX (e.g. react-bits), but I haven’t seen a lot of advises for React Native developers.
  • You can create bridges between JavaScript and native modules, enable messaging between two sides of an app, create your own components.
  • Sometimes just a few lines of native code can save you from dozens of unneeded JavaScript.Do not estimate Android iOS equallyPersonally I spend much more time on configuring iOS apps.
  • Your apps are native and that’s awesome, but Android and iOS are different platforms, with different guidelines and components.
  • So develop and test both versions in parallel.Test on a device from the day oneEmulators are nice, but use devices, especially on Android because of variety of screen sizes, OS versions is use, etc.It won’t be iOS/Android only storySometimes people pick React Native for developing an app only for one platform (yep, seriously).

There are a lot of collections of anti-patterns for React and different app’s state managers like Redux and MobX (e.g. react-bits), but I haven’t seen a lot of advises for React Native developers. In…
Continue reading “React Native Pitfalls – Anton Kulyk – Medium”

flight Ultra Simple Animation Compositions for #ReactJS On Github →

flight
Ultra Simple Animation Compositions for #ReactJS
On Github →

  • The best way to build animation compositions for React.
  • Flight tries to be for React what Principle is for Sketch compositions – the fastest, most friction free way to compose and an effortless way to animate an idea, an interaction, or a short movie-like composition in a self-contained widget (a React component after all).
  • Just clone and use the example, built around :

    And now you can frame your compositions in , require and place it in any other React component.

  • For the cool stuff, it walks the component tree, makes decisions about what should move where, and builds a clean and nice declarative data structure that represents the way compositions should behave.
  • To all Contributors – you make this happen, thanks!

http://www.react-flight.io
Continue reading “flight
Ultra Simple Animation Compositions for #ReactJS
On Github →”

react + d3 = vx – vx code – Medium

#ReactJS + #D3JS = vx, a new #datavisualization library for React:  #D3

  • You just need to use d3 and magic dances across your screen.Of course, the last time you made a chart with d3 was 3 or was it 4 years ago?
  • “I wish there was something more like d3 I could use,” you say.Enter vxreact + d3 = vxMixing two ways to update the DOM is never a good time.
  • Me too.So I set out making a library of low-level components that could be used to build up reusable charts or those one-off requests or that special idea you had for a visualization that you’ve never seen done before.About vxGoal The goal is to create a library of components you can use to make both your own reusable chart library or your slick custom one-off chart.
  • If you’re creating your own awesome chart library on top of vx, it’s easy to create a component api that hides d3 entirely.
  • The vx collection of components lets you easily build your own reusable visualization charts or library without having to learn d3.

You’ve fallen in love with React. You’ve built a redux app. You’ve dabbled with GraphQL. You’ve started following along with Relay Modern and Apollo Client. But your next project is a dashboard that…
Continue reading “react + d3 = vx – vx code – Medium”

Experiments with High Performance Animation in React Native

Three major methods for shape animation with React Native via @salesforceeng

  • This story is my experience and experiments to achieve high performance animation in React Native.Along the way I learned tons from these blogs and recommend you read them as you dive deeper into building your own animations in React Native:React Native Animations Using Animated API from Nader DabitReact Native ART and D3 from Harry WolffBefore we continue, I would like to define what “high performance animation” in terms of my project.
  • Note: There is another OpenGL binding for React Native which enables a more flexible OpenGL implementation without the interface.Animation in React NativeIn my exploration I tested three major methods (with some variations) for doing shape animation with React Native.
  • For example, if we have a shape with a 1px border, it cannot be transformed to have a larger width/height and retain the same border width without redrawing.Experiments and ResultsRequest Animation Frame + JavaScript tweeningThe first approach is to change nothing but use the same code from the web implementation — meaning everything is done in JavaScript without any help from React Native.
  • The gaps between each country will also get scaled so the transformed shapes are not the same as the new shapes.Zoom animation with fade in/outThis method has a significant impact on the memory footprint since there are two views with a shadow node per shape.Animated + Hybrid Native Driver + Animated Shape (ART)For this approach I still used the Native Driver while I found there is a trick to communicate between the JS thread and UI thread using setNativeProps.
  • I first tried with React Native ART and switched to React Native SVG while both give similar results.Animated + Hybrid Native Driver + Animated Shape (OpenGL)After realizing the bottleneck comes from re-drawing shapes, I switched to another library which has the drawing logic implemented in OpenGL.

Archiving decent animation performance is quite tricky. This story is my experience and experiments to achieve high performance animation in React Native.
Continue reading “Experiments with High Performance Animation in React Native”

How to Animate the Items of a React Native FlatList

  • Be sure to subscribe!Animating EntryTo easily demo our animation we’ll animated to insertion of the list item.
  • When a new item is added to the people array we’ll change the opacity of the row and, via transform, the scale and rotation.It’s important to note that inside the TouchableOpacity we’re using an Animated.View which allows us to modify that component using animated values.First we’ll create a new animated value and, when the component mounts, we’ll change that value from 0 to 1 using Animated.timing.Then we need to drive our UI from these values.
  • We can’t do that in componentWillUnmout because the component will be gone before any animations can run!If you test this out though you’ll see that it doesn’t actually do anything — the row just disappears the same as before.If you comment out the onRemove function you can see that the animation is happening.What we can do is call the onRemove function when the animation completes.
  • We’re now left with some subtle, yet slick, animations for each row item for whenever they’re added or removed.
  • It covers component design, Redux, Redux Saga, and more animations!Want more React Native videos?

I was recently asked about animating items in a React Native list — specifically animating the item when added and removed. That’s what we’ll cover today! To accomplish this we’ll use the FlatList…
Continue reading “How to Animate the Items of a React Native FlatList”