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”

GraphQL Authentication with React Native & Apollo [Part 2/2]

GraphQL authentication with React Native & Apollo  #GraphQL #ReactNative #Apollo

  • We’ll use gql to write our graphql query and the graphql higher order component to tap into the Apollo client.We know that our mutation looks something like this (from working with it directly in Launchpad in part 1).
  • Now we need to to be able to pass variables from our user to the mutation.Finally, we want to make this mutation available to the Register component via this.props so that the component agnostic from the Apollo bindings.Now to use it we’ll go to the end of our handleSubmit function…
  • Click “Log Out”, refresh the app, and you’ll see it no longer brings you to profile.Login with Email and PasswordLogging in with email and password is just like sign up, we’re just calling a different mutation.
  • I’ll let the code do the talking.Now to call the login function available on this.props, save the JWT and change screens (on success) or show an error.Showing User InformationThe final thing we’ll do, to demonstrate that things are actually working and it’s not just a big facade, is show the…
  • The server is expecting the JWT to be coming in the authorization header and uses that to find the current user.To pass this token along with the request we’ll use setContext from the apollo-link-context which is another apollo link we’ll use.

This is the second and final part of a series where I cover how to setup authentication with React Native, GraphQL, and MongoDB. Below is part 1 where we setup the server. In this part we’ll be…
Continue reading “GraphQL Authentication with React Native & Apollo [Part 2/2]”

How I built a Content Management System for a React app in one day

How to Build a #ContentManagement System in just 1 day!


#JavaScript #React #Reactjs #CMS

  • DYI content management system with Firebase  ReactHow I built a Content Management System for a React app in one dayFirebase + React = Quick DIY CMSThere are two ways of handling website content:Use a CMS.Hard code in the copy/image urls in the code itself.Option number 2 quick at first, and is fine…
  • However, two big problems will surface and grow as companies scale.In fact, I have personally experienced multiple times the first of these two problems at work.Problem 1: time wasted by engineerEvery time there needs to be a content change, the product team would need to ping an engineer, and the engineer…
  • This will definitely be a problem if the company ever goes international in non-English speaking countries.SolutionThe solution to these two problems is a good content management system.Pillow, where I’m currently working, had a Hackathon last week.
  • Anyone can signup for an account with their gmail, create a project, and add data to the database.Because of the NoSQL structure, I thought it would be a great way to store website copy.
  • This is what I did to structure Pillow’s landing page copy during the Hackathon:Screenshot of json data structurePillow’s website is already built with React, and that made my job a lot easier.All I needed to do on that front is install re-base, set up some configuration, and replace the hard…

Option number 2 quick at first, and is fine for an early stage startup operating in one country. However, two big problems will surface and grow as companies scale. Every time there needs to be a…
Continue reading “How I built a Content Management System for a React app in one day”

VR — for our Children – Anders @LiveTourLab – Medium

VR — for our Children  #github #programming #react #javascript #virtualreality #reactjs

  • VR — for our Children“Worth a fortune, I gave it away for free”My newborn little boy is sleeping peacefully next to me as I just published an open source framework that I hope will help change media at its core.
  • Same as my two bigger children already picture the pre-smartphone era around the time of the dinosaurs.In the future, as my newborn son grows up, he will actively experience VR media, present in the moment, fueling his imagination and strengthening his relationships — if we take the right actions now.Right now, in late 2017 we are at an important intersection.
  • To my knowledge, nothing like it exists today — proprietary or open source.As all cinematic VR experiences of anno 2017, it suffers from a thousand and one issues — hardware struggling to keep up with the resolution needed for sharp images, lack of parallax movement in 360, bulky media files over slow Internet connections, camera handling etc.
  • As my little boy grows up, LiveTourLab will evolve with the VR technology over the years to come.The world can be changed.
  • If you believe in VR and what it can do for mankind, please take one important action right now:PLEASE star the repository on GitHub!It is very VERY difficult to get any new initiative to take off with speed unless big money is spent on heavy artillery marketing, usually from an already big, well-funded Internet company – no matter how free and no matter how good the project is.

My newborn little boy is sleeping peacefully next to me as I just published an open source framework that I hope will help change media at its core. When he grows up, he will listen with mild…
Continue reading “VR — for our Children – Anders @LiveTourLab – Medium”

React Native with Apollo — Part 2, Apollo Client – React Native Development – Medium

  • We return the App component we will create next and wrap it in passing in the client as a prop.
  • create a new query using gql that we will use when we create the higher order component
  • gql will be used to create our query.
  • The graphql method will allow us to create a higher order component for providing Apollo data to a component.
  • create a component named President that we will pass to the higher order component along with the query

Here, we will be using the Apollo GraphQL server we created in part 1 to retrieve data from our database and render it in our app.
Continue reading “React Native with Apollo — Part 2, Apollo Client – React Native Development – Medium”