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”

Building a Wizard / Workflow in React – Entelo Engineering

Building a Wizard / Workflow in React  #react #reactjs #tutorial #reactjs

  • Here are just a few examples:User Registration with multiple formsBreaking large forms into smaller stepsE-commerce checkout flowMulti-page surveysI’ve had previous experiences building out a checkout flow for e-commerce companies, but this was the first time I had to build a workflow using React.Here is the design and the approach I…
  • Finally, we end the workflow with a confirmation page.Each step of the workflow is a separate route we will define in our routes file when using react-router.
  • As we navigate from one step to the next, we will advance the progress bar along with rendering a new container with the next step’s contents.Choosing a Progress BarFor the progress bar, we decided to use the libraryThis is a very simple progress bar and the API is straightforward.
  • Below are some examples of what the progress bar looks like as we move from one step to the next.First StepNext Step to show progression in the workflowFinal StepReact RouterSet up the route to determine what step of the flow we are in.Route path=”jobs/:id/:step” /The id and step will be passed…
  • In the component, we will create a switch case statement to determine what component to render.switch (step) { case (‘description’): return (DescriptionContainer /); case (‘criteria’): return (CriteriaContainer /); …}We also use this stepvalue to calculate the progress bar distance and what progress label should be bold.ContainersWe have a series of…

One of my first tasks at Entelo was to work on a greenfield project that involved a step-by-step wizard. Workflows/wizards are useful when you want the end-user to complete a series of steps. (I’ll…
Continue reading “Building a Wizard / Workflow in React – Entelo Engineering”

Refs in React : All you need to know ! – Hacker Noon

Refs in React : All you need to know !



#reactJS #javascript #developer

  • borrowed from evening while looking into a popular react library, I came across ‘refs’ and even knowing it how it works i wasn’t quite convinced with my understanding so decided to dive more deeper into it and finally sharing my thoughts with you people.According to react docs , refs are used to get reference to a DOM(Document Object Model) node or an instance of a component in a React Application i.e. refs would return the node we are referencing .
  • But i would suggest using classes for use-case of this kind as its much better and also refs has its caveats which we would see soon.When it returns a DOM node or a component’s instance?If the ref points to a standard component (DOM node, such as input, select, div etc) then to retrieve the element; you just need to call this.refs.ref.If the ref points to a composite component (a custom component you have created yourself) you need to use the new ReactDOM module like so is the ref value first set ?
  • Don’t Inline refs callbacks: I used inline callbacks to show you why it is bad thing to doArrow and bind functions in a render() produce a performance hit by creating a new function on EVERY re-render.
  • It should be done something like thisAlso If the ref callback is defined as an inline function, it will get called twice during updates, first with null and then again with the DOM element.
  • ExampleReact Official DocsAs MyFunctionalComponent has no instances , above code won’t work as intended.BUT ref attribute will work inside a functional component as long as you refer to a DOM element or a class component:React Official DocsHope you now have a good understanding of refs along with it use-cases and caveats.

Last evening while looking into a popular react library, I came across ‘refs’ and even knowing it how it works i wasn’t quite convinced with my understanding so decided to dive more deeper into it…
Continue reading “Refs in React : All you need to know ! – Hacker Noon”

React Native — first impressions – Real Life Programming – Medium

React Native — first impressions  #react #softwaredevelopment #reactnative #reactjs

  • Right now QuotesKeeper is already in AppStore and we’ll be posting updated thoughts about React Native soon.Some time ago at DayOne.pl we started a project to build 3 apps with 3 devs in 30 days — the one month project.
  • Most of the knowledge you have about components, lifecycle, state, props, mixins, etc. can be used in your React Native project.
  • Just like you would do in regular React app.There are plenty of libraries ready to be used by your project if any native component is missing.
  • Also built-in React Native list component start scrolling very slow when you have so many elements.
  • You really need to test things out if you plan to work on large datasets.SummaryTo sum things up — would I use React Native in my next project?

First thoughts about React Native after more than a month of iOS app development. Good and bad sides of building your app with React Native.
Continue reading “React Native — first impressions – Real Life Programming – Medium”