Rails, React and me – codeburst

  • It uses rails to include only JS and Webpack compiled files which was perfect match for the use case.Figuring solutions is always easy, The difficult part is to figure out the problemReact_on_rails has given the instructions to setup existing rails project so I started with them but ran into many…
  • In this particular case, figuring out the problem became worse as the errors were misleading.The Aha Moment: Devil was in the detailsFinally to figure out the problem I created a sample project from scratch using react_on_rails new project setup instructions and started comparing the generated code with my existing project.
  • This particular information turned out to be crucial to get out of the problem I was facing which I was not aware of at that time.SolutionTo solve this issue just change your API controller to base controller.
  • Though I would suggest to convert your entire rails-5 api only app to normal rails app.
  • Once you have resolved everything run$bundle installThis will convert your rails-5 API only app to rails app which can easily be integrated with react_on_rails.

Integration of react and rails using react_on_rails gem in an existing rails-5 api only project
Continue reading “Rails, React and me – codeburst”

Creating React Native apps with Django rest-api

A app developer shares how to create React Native apps using Django

  • In this blog post, I am going to share basic steps for developing a React Native app with Django rest-api.
  • I have been mostly developing native mobile apps But sometimes it seems like time consuming to develop a simple app with same functionalities for both iOS and Android.
  • Finally, we create an api function in views.py which will server requests at /api/list end poin_t_ – – We are ready for creating our React Native app now.
  • You can try out expo APIs here – – In Short, React Native is powerful framework for building iOS and Android apps.
  • Find the full source code of React Native app (PyconLunch) on Github.

This blog post explains about creating a simple React Native app with modern tools and packages.
Continue reading “Creating React Native apps with Django rest-api”

Top 10 Web Development Articles This Week on Codeburst

  • Top 10 Web Development Articles This Week on CodeburstWhat’s trending in WebDev this week?
  • Hacktoberfest, async/await, Vue, Node, and JavaScriptWe’re midway through week two of Hacktoberfest.

Mark Muskardin explains the web share API: It’s a JavaScript API that let’s you implement native sharing capabilities from your Mobile Web App. So you have a Vue app you built with the vue-cli and…
Continue reading “Top 10 Web Development Articles This Week on Codeburst”

Changing Default Splash Screen In React Native

  • I remember when I wanted to add a splash screen to my React Native application, it took me a while to implement the feature.
  • I’ve decided to write a blog post about an easy way to add your customized splash screens to your React Native apps.
  • Follow these steps to create and run your app: – – Here is a screen shot of the default splash screen: – – – – Next, you need to generate your splash screen sizes for different mobile views.
  • Here a few examples of splash screen generator sites you can use: Ape Tools, TiCons.
  • Here are the steps to follow: – – I hope you were able to follow the steps to get your splash screens on your apps.

Step by step tutorial on adding splash screens to your applications.
Continue reading “Changing Default Splash Screen In React Native”

Creating React Native apps with Django rest-api

A app developer shares how to create React Native apps using Django

  • In this blog post, I am going to share basic steps for developing a React Native app with Django rest-api.
  • I have been mostly developing native mobile apps But sometimes it seems like time consuming to develop a simple app with same functionalities for both iOS and Android.
  • Finally, we create an api function in views.py which will server requests at /api/list end poin_t_

    We are ready for creating our React Native app now.

  • You can try out expo APIs here

    In Short, React Native is powerful framework for building iOS and Android apps.

  • Find the full source code of React Native app (PyconLunch) on Github.

This blog post explains about creating a simple React Native app with modern tools and packages.
Continue reading “Creating React Native apps with Django rest-api”

Techniques for decomposing React components – DailyJS – Medium

Techniques for decomposing #ReactJS components:  by @Dvtng #JavaScript

  • Here are three techniques to get you started, from the simplest to most advanced.Split the render() methodThis is the most obvious technique to apply: when a component renders too many elements, splitting those elements into logical sub-components is an easy way to simplify.A common and quick way to split the render() method is to create additional “sub-render” methods on the same class:While this can have its place, it is not a true decomposition of the component itself.
  • As a bonus, when React’s new Fiber architecture arrives, the smaller units will allow it to perform incremental rendering more effectively.Templatize components by passing React elements as propsIf a component is becoming too complex due to multiple variations or configurations, consider turning the component into a simple “template” component with one or more open “slots”.
  • Utilise the ability of React to pass elements, not just data, as props, to create a flexible template component.Another component can then have the sole responsibility of figuring out what to fill the metadata and actions slots with.Keep in mind that in JSX, anything that’s between the opening and closing tags of a component is passed as the special children prop.
  • In the comments example, this would likely be the text of the comment itself.Extract common aspects into higher-order componentsComponents can often become polluted by cross-cutting concerns that aren’t directly related to its main purpose.Suppose you wanted to send analytics data whenever a link in a Document component is clicked.
  • The obvious solution might be to add code to Document’s componentDidMount and componentWillUnmount lifecycle methods, like so:There are a few problems with this:The component now has an extra concern that obscures its main purpose: displaying a document.If the component has additional logic in those lifecycle methods, the analytics code also becomes obscured.The analytics code is not reusable.Refactoring the component is made harder, as you’d have to work around the analytics code.Decomposition of aspects such as this one can be done using higher-order components (HOCs).

React components have a lot of power and flexibility. With so many tools at your disposal, it is incredibly easy for components to grow over time, become bloated and do too much. As with any other…
Continue reading “Techniques for decomposing React components – DailyJS – Medium”

React-based UI frameworks – Prototyping: From UX to Front End

React-based UI frameworks  #webdesign #uidesign #webdevelopment #react #javascript #reactjs

  • Most of these are meant more as a window into process (and as a recruiting tool) than as an open standard that other developers can use, but the principles are the same: a reusable library of components with standardized markup.Having a strong design system and a frontend architecture that’s designed to support it is incredibly powerful.Today, even more of the frontend stack has evolved toward a modular, component-based architecture.
  • Here’s the markup for the Feedback component in MailChimp’s library:div class=”feedback-block warning section” role=”status” div class=”lastUnit size1of1″ div class=”c-media” div class=”c-mediaImage v-isFreddicon” span class=”freddicon warn-circle”/span /div div class=”c-mediaBody–centered” h4Account status /h4 p You closed your account on Nov 29, 2013 07:00 pm /p /div /div /div/divDepending on the component, you may also need to include a JS file to handle any interactivity or other logic the component needs.In React, the markup and logic for this component would be defined in only one place, so rendering it would look something like this:Feedback type=”warning” title=”Account status” You closed your account on Nov 29, 2013 07:00 pm/FeedbackReact’s templating system is JSX — this concise version will get translated into the same markup as the top example in the browser.
  • The great thing about this system is that if the keepers of the MailChimp design system wanted to change this component, they’d just change it in one place — the JSX for rendering it would stay the same.
  • In the old world, updating the uses of this component would be a messy and error-prone find-and-replace operation.Having a strong design system and a frontend architecture built around it is incredibly powerful.
  • More importantly, users benefit from a predictable system that works the same everywhere across an app — every time I see a Feedback block in MailChimp it looks and works exactly the same, so my brain spends less effort understanding what’s happening and more on whatever I’m actually trying to accomplish.The list of React-based UI frameworks is steadily growing.

There’s a new crop of web UI frameworks in town, in the grand tradition of Bootstrap, a framework developed at Twitter. Five years ago, Bootstrap was not only an easy way to put together a UI that…
Continue reading “React-based UI frameworks – Prototyping: From UX to Front End”