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?”

The Beauty Of React Native: Building Your First iOS App With JavaScript (Part 2) – Smashing Magazine

Current status: reading my own react native tutorial to recall stuff

  • I added a primitive update mechanism: if the data is stored on device and has not been updated in a week, pull the data across the network again.
  • You see, the components used like the Activity Indicator, AlertIOS, CameraRoll are iOS specific they won’t work on Android.
  • Finally isDoubleTap in the return statement checks if the time difference between the previous and current tap is less than 300 milliseconds ( DOUBLE_TAP_DELAY ), and if the distance between the two consecutive taps is less than 20px ( DOUBLE_TAP_RADIUS ).
  • 23 Alert modal pops up when wallpaper is successfully saved to the Camera Roll.
  • Placing App Icons in appropriate holders.37 Placing App Icons in appropriate holders.

In part 1 of this tutorial we started building our iOS app from scratch. We started out by setting up a blank React Native project. Then we pulled data from the Unsplash.it API. Because downloading data takes time, we built a loading screen. In the process we went over positioning UI elements with flexbox and styling them using CSS-like properties. Towards the end of part 1 we downloaded and included a third-party Swiper component from GitHub, which allowed us to display wallpaper data in a swipeable container.
Continue reading “The Beauty Of React Native: Building Your First iOS App With JavaScript (Part 2) – Smashing Magazine”

React Native Take-off: Getting to know technology & peers

pretty cool logo for the react-native user group … meeting tonight

  • If you want to help me out, let me know what your interests are and if you have worked with React Native before.
  • Overview of the state of the art, getting hands on with React Native, getting to know your peers and building teams
  • Then you can participate in a open end hands-on coding session, where we will start coding with React Native and you will have the opportunity to get to know the other attendees.
  • React Native Take-off: Getting to know technology & peers
  • App developers tired of writing two apps for iOS + Android and mobile website approaches like Cordova getting hands-on with React Native.

Overview of the state of the art, getting hands on with React Native, getting to know your peers and building teams
19:00 Pizza (sponsored by our host)
At 19:30 pm I will give a short intro to React N
Continue reading “React Native Take-off: Getting to know technology & peers”

Online Beginner React Course Learn React in 4 weeks

#React Class for Beginners Starts Tomorrow! Enroll now:  #javascript #reactjs #learnreact

  • Check out our intermediate class with Redux !
  • Codementor React Class: Syllabus
  • Classes will be held on Thursday at 6PM PDT / 9PM EDT .
  • The live group lecture is the core of the class.
  • Codementor Live Class enables you to learn hands-on with a live mentor.

Online React courses – learn React live with an instructor, and receive instant feedback.
Continue reading “Online Beginner React Course Learn React in 4 weeks”