When it comes to state management one of the most popular one you would see is Redux. The reasoning for this is because, it does a really good job. Redux gives all of your components the ability to share information only if you allow it. This makes for a lot more freedom for a developer. Also, one of the great things about Redux is that it is scalable. If you application starts to grow, you will easily be able to increase the functionality of the application without having to refactor all of your components. One con I can think of…

To continue on my quest to become the world’s best developer I’ve figured a developer should have two functionalities locked down. That being upload functionality as well as download functionality. If you missed my upload article, well… It’s right here. When it comes to downloads, It’s a lot less work overall, but it’s not entirely intuitive.

To start off, if you want an item to be downloaded on a click of a button all you really need to do is set up your <a> tag to look something like this:

const link = `http://localhost:3000/image_file/${id}`<a href={link} target="_blank" rel="noreferrer noopener">Download</a>

If…

It seems that hooks are all the rage these days. Therefore, I found it important to learn them myself. You’re probably reading this because you’re in the same shoes I’m in. Well young grasshopper, here’s what I know so far.

To start off, let’s talk about state. To get state in your functional component all you need to do is import it like so:

import React, { useState } from 'react';

It’s that easy you don’t need to download anything. When it comes implementation, it’s also pretty simple. Let’s say you had a form that had a user input information…

Giving the user the ability to upload files to your application should be a tool all developers should have in their back pocket. Though it may seem easy in theory, there’s a lot of overhead that needs to be done to get your database and frontend setup for this type of information.

To start off, this is a guide for Rails as an API in the backend, and React.js in the frontend. First things first, when setting up your backend you’ll need to set up Active Storage so that your database can handle file uploads. It’s as simple as running:

Greetings reader, if you’re a newbie like me in the world of React then you’ve probably stumbled upon the conundrum of adjusting state outside of the parent component.

To start off, let’s get a good understanding of what state is. State in react is essentially;

“The state contains data specific to this component that may change over time. The state is user-defined, and it should be a plain JavaScript object.

If some value isn’t used for rendering or data flow (for example, a timer ID), you don’t have to put it in the state. …

Image for post
Image for post
Photo by Immo Wegmann on Unsplash

Throughout your adventures in learning JavaScript you’ll eventually stumble upon the magical function called, ‘addEventListener.’ This function has an insane amount of power, and as far as my knowledge goes, it is the backbone of creating a web application. It may be tricky to know how to use this method to its highest potential. Advice that I can personally give is to use Bubbling. To explain what bubbling is; “The bubbling principle is simple. When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors.”(https://javascript.info/bubbling-and-capturing)…

And links

As a student learning their way around Ruby on Rails I’ve had many rough patches, but once I started learning how to maneuver around in the back end I wanted to create an efficient way for the user to maneuver around the front end!

Image for post
Image for post
Thanks Staples

As a beginner in the coding world we have many questions and an overwhelming amount of resources that we can learn from. Finding out the differences between buttons and links is too much, and that’s why you’re here.

Buttons are written like this:

           <%= button_to("button", path, method) %>

Let’s break this down. The begging of the…

I would like to preface this blog by stating I AM NEW TO CODING, oh and I AM NEW TO BLOGGING.

Coding is incredibly DRY(pun intended.) When I say that I mean, it’s just numbers and letters on a screen. There isn’t anything stimulating on the screen and for people like me that are visual learners, understanding material is incredibly difficult. I can’t learn what I can’t picture, therefore in my mind I have to ‘visualize’ what the code I’m writing does. For example, let’s take a Class (or a thing or an object) like Horses!

In code world, this…

Ignas Butautas

An aspiring coder, trying to make sense of The World (of coding.)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store