All You Need To Know About CSS-in-JS – Hacker Noon

  • CSS-in-JS attached a style tag on top of the DOM while inline styles just attached the properties to the DOM node.Why does this matter?Not all CSS features can be aliased with JavaScript event handlers , many pseudo selectors aren’t possible, styling the html and body tags isn’t supported etc.With CSS-in-JS, you…
  • Some libraries (like jss, styled-components) even add support for neat, non-CSS-native features like nesting!Brilliant article going in depth on how they’re different.“Just write the darn CSS in CSS and be done with it.”Yes — while that’s the case for how it’s been done for a long-long time — the challenge is modern web is…
  • Shout-out to Vue for solving this problem beautifully even tho Vues styles have no access to components state.Here’s Bob Ross painting rocks to cool down the tension 😄What are the benefits of using CSS-in-JS?
  • CSS-in-JS leverages the full power of the JavaScript ecosystem to enhance CSS.“True rules isolation” — Scoped selectors are not enough.
  • JSS generates unique class names by default when it compiles JSON representation to CSS.Vendor Prefixing —The CSS rules are automatically vendor prefixed, so you don’t have to think about it.Code sharing — Easily share constants and functions between JS and CSS.Only the styles which are currently in use on your screen are…

TL;DR: Thinking in components — No longer do you have to maintain bunch of style-sheets. CSS-in-JS abstracts the CSS model to the component level, rather than the document level (modularity). You…
Continue reading “All You Need To Know About CSS-in-JS – Hacker Noon”

Day 36: Soon Come Soon – conshus – Medium

Day 36: Soon Come Soon  #hiphop #firebase #react #coding #ux #reactjs

  • Did a little bit of coding.Monday: Since I was off for Labor Day, I decided to devote the day to really getting a lot done on my refactor project.
  • I learned A LOT about what you can and can not do in React!
  • Worked out the integration of using Google Sheets as a backend to update my info section.
  • That turned out to be a lot more difficult than I thought, but I think it will be beneficial in the end.
  • I also got the audio player working the way I want.Right now, all I have to do is add the content for the thank you and tech built with sections of the info page.

Right now, all I have to do is add the content for the thank you and tech built with sections of the info page. I’m thinking I want to add a section to put my shirt shop just incase if people want to…
Continue reading “Day 36: Soon Come Soon – conshus – Medium”

Iterators Using ES6 – Felipe Valdivia – Medium

  • However, as is often the case when a task occurs frequently, JavaScript now provides methods that simplify this task.These methods, called iterators, are called on arrays and complete such tasks as altering each element and selecting elements that fit certain criteria.So in this article you are going to learn how to use some of this iterator.
  • forEach()” will execute the same code on each element of an array.forEach() ExampleThis iterator will execute the same code on each element of an array, so in the example above we are going to go over each element in our array and print it on the console, the argument that you can see in parenthesis doesn’t matter in this case we are using “fruitItem” because is a good practice to have descriptives names.
  • map() iterator but in this case we are creating a new array with the result, so we need to create the variable and inside the block have the condition, that in this case we are going to create a new array with all the numbers divided by 100.
  • filter() exampleIn this example you can see how with filter we go over all the items but we just return the ones that are shorter than 6 characters creating a new array just with these data that is already filter for our condition.ConclusionYes I know this article is short but I present to you 3 different types of iterator using javascript with this you can start playing with them creating projects just to get familiar with them.I can give you some research task that you can do, look for this 3 other that they are pretty common and learn how to use them, I hope you can start a project with this information or solve different problems.so briefly we can say:.
  • filter() checks every element in an array to see if it meets certain criteria and returns a new array with the elements that return truthy for the criteria.You can visit the Mozilla Developer Network to learn more about iterator methods (and all other parts of JavaScript!)

Hello guys this is my second article here about front end and this time I am going to be talking about the different iterators that we have in EcmaScript6. The idea of this post is just show you some…
Continue reading “Iterators Using ES6 – Felipe Valdivia – Medium”

New & Upcoming Course Highlights: Introduction to Core Data & React Native

Read more about our new #ReactNative and #CoreData courses here:  #learntocode

  • Here’s a short list of what we’ve added recently, upcoming course highlights, and our weekly video update of What’s New at Treehouse.
  • React Native is a great option for creating performant iOS and Android applications that feel at home on their respective platforms, all while building on any previous web development experience.
  • In this course we will be building the ultimate superhero app.
  • By the end of this course you should have the confidence to build upon the app that we started and take it to the next level.
  • Saving data on your device is a fundamental part of building apps and in this course we’re going to learn how to use the Core Data framework to persist data between launches by building a simple to-do list app.

Every week, new courses and workshops are published to the growing Treehouse Library! Here’s a short list of what we’ve added recently, upcoming course highlights, and our weekly video update of What’s New at Treehouse.
Continue reading “New & Upcoming Course Highlights: Introduction to Core Data & React Native”

Buid simple React Apps Using Event Emitters – Mokanarangan Thayaparan – Medium

Build simple #ReactJS apps using event emitters

  • Buid simple React Apps Using Event EmittersBuild simple React Apps using Event EmittersI admit the debate for Redux Vs Flux has been settled and there is no point a system so trivial as Eventemitter.
  • I have decided to take a Todo application as example.The usual way of implementing a ToDoThen I added my only clientclass BaseClient {/** * Initiate the event emitter */ constructor() { this.eventEmitter = new EventEmitter(); }/** * Adds the @listener function to the end of the listeners array * for the event named @eventName * Will ensure that only one time the listener added for the event * * @param {string} eventName * @param {function} listener */ on(eventName, listener) { listener); }/** * Will temove the specified @listener from @eventname list * * @param {string} eventName * @param {function} listener */ removeEventListener(eventName, listener) { listener); }/** * Will emit the event on the evetn name with the @payload * and if its an error set the @error value * * @param {string} event * @param {object} payload * @param {boolean} error */ emit(event, payload, error = false) { this.eventEmitter.emit(event, payload, error); }/** * Returns the event emitter * Used for testing purpose and avoid using this during development */ getEventEmitter() { return this.eventEmitter; }}The comments hopefully.
  • Now we can separate the two components and connect it with only events.Add listener at component mount and remove them at unmout// Listen for event componentWillMount() { client.on(‘TODO_ADDED’, this.addEvent); } //Remove listener componentWillUnmount(){ this.addEvent); }Now you don’t need to pass the addEvent function as a prop.Voila.
  • But simple modular ones, easy to maintain.This way we can have multiple modular components that doesn’t need to know about other components.
  • This is not rocket science but this might help you build simple apps without much hassle.

I admit the debate for Redux Vs Flux has been settled and there is no point a system so trivial as Eventemitter. But having worked with React and Redux for more than a year I found out two things. In…
Continue reading “Buid simple React Apps Using Event Emitters – Mokanarangan Thayaparan – Medium”

Sharing state in a Symfony hybrid with Twig, React and other JavaScript apps

  • I still wanted to keep working with these two applications fluent, so I decided to share the state of the object via a dedicated object.
  • The way I see it is that this sharing of a state object can reduce friction on working with PHP-JavaScript hybrid applications by removing guessing variable names and inventing new data structures.
  • A while back I was working on an application where the back end is a full stack Symfony application.
  • In the end we’ll pass the Twig templating engine the object as well as the serialized state.
  • I was working on decoupling the front end completely by having the Symfony app serve only as an API backend.

Front end development has certainly grown up in the last few years. UI logic is increasingly being moved to the client side, but the tradit…
Continue reading “Sharing state in a Symfony hybrid with Twig, React and other JavaScript apps”

Nishant Agrwal’s response to Why isn’t React called framework? What does it lack to be a framework?

Why isn't React called framework? ⚛  #ReactJS #JavaScript @reactjs

  • It is a framework in the sense that it absolutely does have a predefined architecture and infrastructural design and it calls into your code to fill in the details.
  • It is the framework code that runs first and that calls into your code to determine what has to be done at a high level.
  • The difference between a library and a framework has to do with Inversion of Control .
  • The code written by the user of a framework just defines in an abstract way the specifics of that particular application.
  • At the end of the day it is more important to understand how React is different from the classic examples of either a library or a framework.

Why isn’t React called framework? What does it lack to be a framework?
Continue reading “Nishant Agrwal’s response to Why isn’t React called framework? What does it lack to be a framework?”