Why shouldn’t I use jQuery in React?

  • what you could do in theory is move the state outside of react in something like redux.
  • so JQuery does something -> statecontainer gets the update -> react will do something accordingly.
  • in theory react is just a view library, so you could use jquery to build your framework and render everything with react still react can only “see and hear” what’s happening in react.
  • it’s functional so it does not care about the global state unless you patch it in.
  • I would not use jQuery in react unless it’s really necessary, which it’s probably not.

Almost everyone is saying: »Don’t use jQuery in React!«
But they don’t really explain why. They just say don’t use it. I haven’t found any good reasons yet. No problem to use it! Example: VS Don’t use it! Why:.
Continue reading “Why shouldn’t I use jQuery in React?”

Lottie – Render After Effects animations natively on Web, Android and iOS, and React Native

Lottie - Render After Effects animations natively on Web, Android and iOS, and React Native

  • Lottie is a mobile library for Web, and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile!
  • Install the zxp manually following the instructions here: Skip directly to “Install third-party extensions” – – Or you can use the script file from here: Or get it directly from the AE plugin clicking on Get Player – – Here’s a video tutorial explaining how to export a basic animation…
  • — with 1 optional parameter name to target a specific animation – – bodymovin.stop() — with 1 optional parameter name to target a specific animation – – bodymovin.setSpeed() — first argument speed (1 is normal speed) — with 1 optional parameter name to target a specific animation – – bodymovin.setDirection()…
  • — with 1 optional parameter name to target a specific animation – – bodymovin.searchAnimations() — looks for elements with class “bodymovin” – – bodymovin.loadAnimation() — Explained above.
  • you can also use addEventListener with the following events: – – Doing this you will have to handle the canvas clearing after each frame – – Another way to load animations is adding specific attributes to a dom element.

lottie-web – Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
Continue reading “Lottie – Render After Effects animations natively on Web, Android and iOS, and React Native”

I interviewed @nemshilov about A+ Forms, his new form solution for #reactjs

  • Engineers think of forms as a bucket of input fields that spits out a blob of data which we then retrieve and send to the server.
  • I built A+ forms for the same reason, so my engineers and I don’t have to solve this problem over and over again and can focus on making what we want to develop.
  • Here are the next extensions that I’m planning to build: – – A+ forms have a bunch of standard fields out of the box, but they’re not tied to any particular UI component implementation.
  • Form management in native mobile apps is alien to us web developers.
  • If we re-implement those fields in React Native components, then engineers could have the same developer experience between web and native apps.

If you think about it, a lot of web development has something to do with forms. Every time you capture information, you most likely require a form. It’s one of the basic skills for a front-end developer.
Continue reading “I interviewed @nemshilov about A+ Forms, his new form solution for #reactjs”

Horizontal scroll animations in React Native – codeburst

  • Horizontal scroll animations in React NativeLink Animated with ScrollView to create a nice navigation UI animation in React NativeWhat we will be buildingRN lets you build a nice and smooth UIWhat you will needReact NativeSimulatorNo third party libraries required :)Creating Screen component with AnimatedFirst, import Animated, Dimensions, ScrollView, StyleSheet, Text, View from “react-native” .
  • Next, create a component that will be treated as a screen or a view.We are using Animated.View here because we are going to animate that wrapper component.That width ofscrollPage style and are important because we are going to interpolate horizontal scrolling values to multiple animation values.
  • In other words, we are going to track where the screen is and animate the screen component based on that value.It’s one of the things that are tricky to explain in words, but it is the key concept to understand for this to work.Basically, we link animations based on the…
  • When the scroll position is at 150, first screen is half way done exiting, and the second screen is half way done entering.Adding animationsSince they are all set up, it is time to write the animations.
  • You would have to write a different inputRange since FlatList removes items that scroll way off screen.I think this is pretty neat UI animation that’s pretty simple to use.

That width ofscrollPage style and transitionAnimation(props.index) are important because we are going to interpolate horizontal scrolling values to multiple animation values. In other words, we are…
Continue reading “Horizontal scroll animations in React Native – codeburst”

Our Journey Building a React Native App

  • Magento specialists, The App Store and The Play Store – three things rarely spoken about in the same sentence – – Then an existing client of ours, one that’s been having month on month growth from an existing Mobile-friendly website we built for them, approached us with a new request:…
  • React Native is a platform that allows Javascript developers to create Apps for both iOS and Android, all from the same Codebase.
  • There are other solutions out there than achieve similar results, but some of the reasons for choosing React Native were as follows: – – So we had the answer now, yes – JavaScript developers can produce an application that will run run on both iOS and android (thanks to react…
  • I don’t think it’s a good idea to become an Angular developer – or a React developer, you should instead strive to become an expert in JavaScript – doing so will allow you adopt new tools, libraries and frameworks as they come in and out of fashion without much work….
  • Jest – – There’s a huge amount of regular JavaScript that goes into a React Native application – especially when you’re handling side-effects away from components like we are with redux-observable.

Then an existing client of ours, one that’s been having month on month growth from an existing Mobile-friendly website we built for them, approached us with a new request: An App on both iOS and Android, capable of covering some of the offline features not currently possible on the Web.
Continue reading “Our Journey Building a React Native App”

Why We Use Styled Components – Hacker Noon

Why We Use Styled Components:  by @_alanbsmith #JavaScript #ReactJS

  • That’s not what CSS-in-JS is about regardless of the hype.Styled Components Isn’t the Right Choice for Every TeamI’m not saying Styled Components is better than Radium, Aphrodite, Glamor, Glamorous, Emotion, or any of the other CSS-in-JS libraries.
  • BEM, SMACSS, and other CSS patterns provide a lot of great guidelines for managing styles.
  • 🎉)From my experience, building a component library is the best way to keep UI consistent and predictable across applications, and CSS-in-JS has been the best tooling available to build these libs.Why We Chose Styled ComponentsWe ❤️ Styled ComponentsWe were drawn to CSS-in-JS for the reasons mentioned above, but Styled Components…
  • Along with the basic Sass support, there’s also Polished, a small toolset created by Styled Components to provide additional Sass functionality and other helpful tooling.Native Mobile SupportOur team is also in the process of developing a native mobile app with React Native.
  • Those conversations will help establish patterns for best-practices leading us to more consistent and predictable UI.Final ThoughtsStyled Components has been great for our team, and I think it could be really useful for a lot of other teams as well.

Unfortunately Twitter is not ideal for providing context and longer explanation, and I thought this might be a good way to follow up. Given that, a lot of this article describes what led to our…
Continue reading “Why We Use Styled Components – Hacker Noon”

Improving the usability of your modules – kentcdodds

Improving the usability of your modules  #reactjs

  • All you have to do is use it:import getContentForFile from ‘react-i18n’const i18n = App() { return ( div h1{i18n(‘header.title’)}/h1 /div )}So that’s how it works (again, I’m sure some of you are thinking of other libs that could do this better, but please spare me the “well actually.” I’m aware…
  • const content = JSON.parse( … more stuffexport {getContentForFile as default, init}This presents a few challenges for users of the module.
  • Turns out that react-i18n actually exposed another module react-i18n/bootstrap to customize this behavior which is great, but that doesn’t resolve the problem of stuff happening if someone were to import react-i18n first.So what I did was a wrapped all side-effects in a function I exported called init(which was similar to…
  • But it’s ok now because that’s clear const messages = JSON.parse( ) // … other other stuff}// … more stuffexport {getContentForFile as default, init}So this means that anyone using the module now must call the init function, but they’re doing that on their own terms and whenever they want it…
  • However, we’re in the process of “inner sourcing” this module (and perhaps open sourcing it eventually), so folks are going to use it who use different tools and have different use cases.So, if it’s not too much work and doesn’t add too much complexity, then try to make the solution…

NOTE: This is a cross-post from my newsletter. I publish each email two weeks after it’s sent. Subscribe to get more content like this earlier right in your inbox! 💌 This last week I worked on my…
Continue reading “Improving the usability of your modules – kentcdodds”