Introducing form-for. ReactJS Forms Made Easy – Pedro Silva Moreira – Medium

Introducing form-for. #ReactJS Forms Made Easy

  • Binding componentsAs you can see on the code above, each field has a type set to it; some even have a couple extra properties.Now, we need to tell form-for what components to render.
  • I created a package for bootstrap components that makes your life veeery easy.
  • Building the formNow, let’s put together the User, the bootstrap components and the Form and Field tags.4.
  • The code is very straight forward, just like the one you saw above.And if you want more sandbox examples, I have two others in my profile: MobXFormFor goes really well with MobX.
  • If you don’t like comment too, lemme know how you think it could be

I’ve been coding for a few years and played with a few technologies. In this path, I’ve become a big fan of a Rails gem called simple_form. I’m also a fan of React. With these two in mind, I decided…
Continue reading “Introducing form-for. ReactJS Forms Made Easy – Pedro Silva Moreira – Medium”

Ending the debate on inline functions in React – Flexport Engineering

Ending the debate on inline functions in React  #reactjs

  • In the example above, this.props.onAlert in the callback has the correct reference to this.Why do other people dislike inline functions?An inline function in render allocates a new function instance each time render is called.
  • However, in Flexport’s React app, the garbage collector penalty is dwarfed by another performance issue caused by inline functions: wasteful re-rendering of pure components.Recall from Part 1 of this blog series that pure components rely on a shallow equality comparison in shouldComponentUpdate to determine if any props or state have…
  • Since two different function instances are never equal, inline functions will cause the shallow equality comparison to fail, and thus will always trigger a re-render.
  • So as a React developer, what in the world are you supposed to do?reflective-bind to the rescueThe answer: freely use inline arrow functions in render, and use our ✨new✨ reflective-bind Babel transform to eliminate wasteful re-renders with almost no code change.Total internal reflection.
  • To do that, the Babel plugin hoists the arrow function to the top level, and replaces it with a call to reflectiveBind, passing in the hoisted function and the closed over variables as arguments:With these transforms in place, we can use reflectiveEqual in our shouldComponentUpdate to check for function equality.Performance…

Using inline functions in React is convenient but can be contentious because of their perceived impact on performance. Today Flexport is introducing our solution to the debate: a Babel transform…
Continue reading “Ending the debate on inline functions in React – Flexport Engineering”

The Pros and Cons of ReactJS for your Online Business

The Pros and Cons of ReactJS for your Online Business  via @janlgordon

  • With React, it is possible for webmasters and online business owners to develop large web-based applications that change data while reloading pages.
  • Webmasters can also use React together with other forms of frameworks or JavaScript libraries like Angular in MVC.
  • It makes it possible to reuse components that didn’t produce changes, and this makes programming more comfortable and precise for online business owners.
  • The great news for webmasters is that Google might still find the React component when just the client-side is rendered.
  • ReactJS is a great framework for online business.

This isn’t quite a ReactJS guide for the layman. But it is a useful for business owners, if only to glean enough to know how to talk with your techie
Continue reading “The Pros and Cons of ReactJS for your Online Business”

How to mobilise your idea – Cogent Blog

How to mobilise your idea  #javascript #reactnative #javascriptdevelopment #reactjs #reactjs

  • But for a feature rich app experience, it’s just not going to give good enough results.Even Facebook initially built their app as a mobile web app to be able to roll out features faster, but eventually switched back to native.Write once, build nativeIf each native platform needs code written in it’s…
  • Microsoft has invested heavily in cross platform mobile tooling, because as less than 1% of the global market for mobile devices, no one is going to build apps for just their platform alone.A slightly different approach is used by React Native (and Native Script).
  • While the word hybrid is certainly apt, React Native works so differently from the HTML based hybrid app options, I’d like to think of it as different class instead, with it’s main characteristic being the way it plays puppeteer to the native interface.The way that this works in practice is…
  • If your JavaScript decides to make the header bar change colour, it sends a message to the main native app thread, saying “the header bar should be red now”, and the native header bar widget changes it’s colour to red.This is only different from truly native mobile in a few…
  • So far, I haven’t needed this escape hatch, but it’s good to know that it’s there.SummaryHere’s my opinionated breakdown.Separate native mobile apps give a good result but having multiple code-bases is both too expensive and too slow for fast-moving companies.Mobile friendly web design is very important for all websites, but…

You’re an entrepreneur or project manager trying to see if a technical decision is right for your business, but what’s the most cost effective way for your engineers to build a mobile product? As a…
Continue reading “How to mobilise your idea – Cogent Blog”

Why Do Developers Now Compare Vue.js to JavaScript Giants Angular and React?

Why Do Developers Now Compare #VueJS To #JavaScript Giants #AngularJS And #ReactJS?

  • It was 2016 when Vue.js rose to fame and gained so much traction that it’s now seen as an alternative for even well established JavaScript libraries, such as Angular and React.
  • Since Angular belongs to search engine giant Google and React comes from social media behemoth Facebook, developers still trust and use those libraries more than Vue.js.
  • This blog attempts to shed light on why there is a growing belief among developers that Vue.js is set to become the top JavaScript library, leaving behind Angular and React.
  • The reason many developers are turning to Vue is that it addresses the issues of React and Angular.
  • But, one must not forget that Angular and React are still very big names in the JavaScript world, whereas Vue has just begun to rise.

Vue.js, an MIT-licensed open source project, is a JavaScript library for building web interfaces. The library was first released in 2013, but not many developers took cognizance of it in web framework technology for the next two years. It was 2016 wh
Continue reading “Why Do Developers Now Compare Vue.js to JavaScript Giants Angular and React?”

react-tv now supports @reactjs 16.0.0 and use React-Reconciler! Thanks to @NTulswani :)

  • React-TV is a ecosystem for React Application for TVs (from the renderer to CLI for pack/build applications) focused now on WebOS and SmartTV.
  • The mission of React-TV is build & develop fast for TVs.
  • The strategy is step in the renderer: Applying reactive concepts to unblock the processing on renderer layer, plug the TV’s keyListener, avoid React.createElement (which cost a lot)[…] – – In addition: Unify the build for multiple TV platforms.
  • When building a cross-platform tv app, you’ll want to re-use as much code as possible.
  • React-TV provides module to easily organize your code and separate it by platform: – – WebOS, also known as Open WebOS or LG WebOS, (previously known as HP WebOS and Palm WebOS, stylized as webOS) is a Linux kernel-based multitasking operating system for smart devices such as Smart TVs and…

react-tv – [WIP] React development for TV (Renderer for low memory applications and Packager for WebOS, Tizen, Orsay) 📺
Continue reading “react-tv now supports @reactjs 16.0.0 and use React-Reconciler!
Thanks to @NTulswani :)”

Creating an Accessible React Website

  • The problem is that a newly server rendered page works great with a screen reader but when you change routes in an SPA, the screen reader does not know that there is new content.
  • With this higher order component in place, I can now add the correct labelling to any component such as the component previously described: – – The higher order component above takes care of displaying an error below each invalid field but a screen reader will not automatically pick this up…
  • Below is an exmple of such a validaion summary from gov.uk that I based our validation summary on: – – At first glance this is complete overkill for 2 fields but in the context of a screen reader, this is a great practice.
  • In the event of an error, focus is placed on the element in the component and a link is created for each validation error.
  • Below is a help container that expands and contracts when a link is clicked: – – A combination of , and are used to correctly instruct the screen reader that new content is toggled between visible and invisible states.

I’ve recently been working on an online application form in the form of a multistep wizard that had strict accessibility requirements. I’ …
Continue reading “Creating an Accessible React Website”