Search
Fix Seeing “0” in Your JSX Code
9.7.2021
The early days of the web felt like the wild west when it came to coding practices — just make it work. Then we became enlightened to better practices, separating HTML from CSS and JavaScript. Then came React and JSX, where we combine JavaScript, HTML, and even CSS with Styled Components...
React Without Build Tools
3.3.2021
Jim Nielsen:
I think you’ll find it quite refreshing to use React A) with a JSX-like syntax, and B) without any kind of build tooling.
Refreshing indeed:
CodePen Embed Fallback
It’s not really the React that’s the hard part …
The post React Without Build Tools appeared first...
How to Add Native Keyword Aliases to Babel
16.4.2020
Those of you who follow this blog know that not every blog post is an endorsement of a technique but simply a tutorial how to accomplish something. Sometimes the technique described is probably not something you should do. This is one of those blog posts. The Babel parser is an essential tool...
CSS2JS
20.3.2020
To add inline styles on an element in JSX, you have to do it in this object syntax, like:
<div style={{
fontSize: 16,
marginBottom: "1rem"
}}Content
</div
That might look a little weird to us folks who are so used to the CSS syntax, where it is font-size (not fontSize), margin-bottom...
Considerations for Creating a Card Component
2.3.2020
Here's a Card component in React:
const Card = props ={
return(
<div className="card"<h2{props.title}</h2<p{props.content}</p</div)
}
It might be pretty useful! If you end up using this thing hundreds of times, now you have the ability to refactor a little bit of HTML...
Apollo GraphQL without JavaScript
29.1.2020
It's cool to see progressive enhancement being done even while using the fanciest of the fancy front-end technologies.
This is a button in a JSX React component that has a click handler applied directly to it that fires a data mutation Ajax request through Apollo GraphQL. That is about the least...
PHP Templating in Just PHP
26.12.2019
With stuff like template literals in JavaScript and templating languages, like JSX, I've gotten used to wanting to write my HTML templates in one nice chunk and sprinkling in variables wherever I need them.
I had a situation where I needed to do that in "raw" PHP the other day, so I'm just...
How to Modify Nodes in an Abstract Syntax Tree
26.12.2019
One of the more powerful concepts I've stumbled across recently is the idea of abstract syntax trees, or ASTs. If you've ever studied alchemy, you may recall that the whole motivation for alchemists was to discover some way to transform not-gold into gold through scientific or arcane methods.
ASTs...
What I Like About Writing Styles with Svelte
23.10.2019
There’s been a lot of well-deserved hype around Svelte recently, with the project accumulating over 24,000 GitHub stars. Arguably the simplest JavaScript framework out there, Svelte was written by Rich Harris, the developer behind Rollup. There’s a lot to like about Svelte (performance, built-in...
Collective #547
9.9.2019
How Video Games Inspire Great UX * js-noisy-gradient * PowerToys * SVG to JSX * Google Engineering Practices Documentation
Collective #547 was written by Pedro Botelho and published on Codrops
React Starter: How does JSX make HTML elements?
3.7.2019
JSX makes making React components easier. Some may find JSX to have a high learning curve and that's totally understandable. It's not exactly HTML and it's not exactly JavaScript, so it can take so
React Starter: JSX Gotchas
20.6.2019
JSX is a very powerful technology. With all new things that we have to learn, there is a bit of a learning curve. Let's talk about some of the gotchas when using JSX. These are some common things t
React Starter: The Many Ways to Return JSX
13.6.2019
JSX is a great tool because it has so much flexibility. There are many ways to achieve the same thing. For this reason, it can be confusing for new developers when they see different tactics for de
React Starter: JSX Basics
11.6.2019
JSX is the templating language for React. JSX is also one of the main reasons why devs say they dislike React at first.
As with all new tools, there will be a learning curve. JSX is no diffe
10 React Challenges (Beginner): Loop Over and Display Data with JSX
10.5.2019
Data comes in all shapes and sizes. In JavaScript, an array is how we hold sets of data. For the majority of our site content, we use an array of objects.
Looping through and sh
10 React Challenges (Beginner): Display Simple Data with JSX
10.5.2019
One of the building blocks of React is the ability to use HTML elements when developing components.
JSX allows us to write simple markup in HT
10 Days of React Challenges (Beginner): Loop Over and Display Data with JSX
10.5.2019
Data comes in all shapes and sizes. In JavaScript, an array is how we hold sets of data. For the majority of our site content, we use an array of objects.
Looping through and sh
10 Days of React Challenges (Beginner): Display Simple Data with JSX
10.5.2019
One of the building blocks of React is the ability to use HTML elements when developing components.
JSX allows us to write simple markup in HT
Naming things to improve accessibility
2.5.2019
I like the this wrap-up statement from Hidde de Vries:
In modern browsers, our markup becomes an accessibility tree that ultimately informs what our interface looks like to assistive technologies. It doesn’t matter as much whether you’ve written this markup:
in a .html file
in Twig, Handlebars...
React indeterminate
22.1.2019
I’ve fallen in love with React.js and JSX over the years; state-based rendering and a logical workflow have made me see the light of this modern framework. That doesn’t mean I don’t sometimes get a bit frustrated that the “simple” things seem harder than they should...