DEV Community

Cover image for What JavaScript do you need to know to write Single-Page-Applications more effectively: A Guide

What JavaScript do you need to know to write Single-Page-Applications more effectively: A Guide

RoryJZauner on July 22, 2021

If you are interested in knowing what aspects of JavaScript are going to be important for frameworks such as React or Vue, then this article is for...
Collapse
 
larsejaas profile image
Lars Ejaas • Edited

This is a very useful article for anyone new to frameworks!

If the module isn't exported as default (this could be in a file with multiple exports), it is possible to import the module(s) like this:

import { module1, module2 } from "./modulefile"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
rjzauner profile image
RoryJZauner

Thank you for your reply! Your point is really helpful

Collapse
 
mohithgupta profile image
K.Mohith Gupta

Nice article!! But...For detailed explaination on fetch you can read this article here
Anyone having trouble understanding fetch, can read that article

Collapse
 
rjzauner profile image
RoryJZauner

Hi 👋 awesome for sharing! Thank you!

Collapse
 
andrewrooke profile image
andrewrooke

I am certainly no developer, but I was working on a quick simple proof of concept (POC) last week for an SPA (React, with a JSON file for a data store) to fix an internal problem. The biggest issue I struggled with what my lack of understanding of Hooks and passing state between components.

Collapse
 
rjzauner profile image
RoryJZauner

Awesome! Thank you for your reply. I am currently working on an example app where I am using React and Hooks to manage state. I hope I can have that ready soon.

Collapse
 
vitaragshah profile image
Vitarag Shah • Edited

A Single Page Application (SPA) is a modern web development approach that delivers a seamless and responsive user experience by loading and rendering all necessary content within a single web page, eliminating the need for constant full-page reloads. SPAs leverage JavaScript frameworks like React, Angular, or Vue.js to manage dynamic content, allowing users to interact with the application without experiencing the typical interruptions associated with traditional multi-page websites. This approach enhances speed and interactivity, making SPAs a preferred choice for many web developers when building complex web applications, such as social media platforms, online marketplaces, or productivity tools, as it provides a more fluid and engaging user experience.

Collapse
 
drsimplegraffiti profile image
Abayomi Ogunnusi

Nice post.....

I don't understand the the const variable explanation...or is it a typo?

Collapse
 
peerreynders profile image
peerreynders

Probably should have been

these are variables whose value will not change over time.

but even that isn't correct.

Quote

The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable—just that the variable identifier cannot be reassigned. For instance, in the case where the content is an object, this means the object's contents (e.g., its properties) can be altered.

The wrinkle is that

Quote:

All types except objects define immutable values (that is, values which can't be changed). For example (and unlike in C), Strings are immutable. We refer to values of these types as "primitive values".

This gives people the impression that const works differently for primitive values and objects - it's just that the binding is immutable - not the value which why you can still modify the internals of objects (and arrays which are objects).

Collapse
 
rjzauner profile image
RoryJZauner

Thank you for helping me out! Awesome explanation!

Collapse
 
rjzauner profile image
RoryJZauner

Thank you for your reply - I tried to make the explanation a touch easier to understand, but I guess it ended up being more confusing 😅