- 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”
- 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]”
- 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“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”
- js for the progress bars (these involved an annoying amount of math because of how the library works, but I’m not going to get into it for my own sanity), and just regular React components for the list of items, and for each item.
- After working on this and getting everything mostly functional in React, I realized that the app would work best if I could make the app “reset” when the day ended (moving the paused items to the uncompleted list, and resetting the progress bar).
- But, because the date and the list components were unrelated, I had a decision to make: Do I restructure the app so that the state is in the parent component, and everything changed is passed via props, OR do I add Redux to the app to have a global store I can keep track of?
- Adding Redux also made persisting app state with local storage super easy too (literally only took two functions, it’s beautiful).
- That “reset” function I wanted was an easy call with it, and the app reset on a new date.
Just released my latest side project with Electron, React, and Redux!
Continue reading “Building todometer: a meter-based to-do list”
- Two weeks ago we changed our name from Exponent to Expo, and last week we shipped two projects that we have been working on for a few months!Create React Native AppOn Monday, March 13 2017 we announced Create React Native App at React Conf.
- You can read the announcement blog post over on the React Native blog, and check out the differences between create-react-native-app and Expo in our docs.
- Just like Create React Native App did last Monday, on Tuesday the Expo Sketch announcement blog post hit number 1 on Hacker News and remained on the front page all day (link to the post).
- So we wired up Discourse with our account system and launched it earlier this week.Go to https://forums.expo.io and sign in with your Expo account, then introduce yourself and let us know what you’re working 8 support has been dropped from ExpoAs we mentioned in the SDK14 release notes, with SDK15 we have dropped support for iOS 8, following the lead of apps like Twitter and Slack that did this months ago.According to Mixpanel Trends data, worldwide iOS 8 usage comes in at a total of 1.18 percent.
- If you depend on this, you should switch it out with a normal ScrollView.Upgrading your app to Expo SDK v15.0.0 from v14.0.0If you are still using exponent packages instead of expo, please follow the steps described in Updating your project for the Exponent → Expo name changeClose XDE or your exp CLI serverIn exp.json, change sdkVersion to “15.0.0”In package.json:- change react-native version to change expo version to “^15.0.2”- delete your project’s node_modules directory and run npm installagain.Re-open XDE or exp and start your project once npm install from the previous step has completed.Update the Expo app on your phones from the App Store / Play Store.
Expo SDK 15.0.0 is based on the recently released React Native
0.42.0, “February”. This is a jump of 1 version of React Native; Expo
SDK 14.0.0 was based off of 0.41.0, “January”. Two weeks ago we…
Continue reading “Expo SDK v15.0.0 is now available – Exposition”
- 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”