# React vs Vue

⚡️ Tags: 📍Comparison 📍Framework

# Online tools

https://codesandbox.io/s/vue

https://play.vuejs.org/

# Template syntax

# Mounting app

<div id="app"></div>

# Fragments

Fragment allows you to return multiple elements from a component by allowing you to group a list of children without adding extra nodes to the DOM.

# Raw HTML

WARNING

Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to XSS vulnerabilities. Only use v-html on trusted content and never on user-provided content.

# Computed Properties

Putting too much logic in your templates can make them bloated and hard to maintain.

# Conditional Rendering

# If, else

# Conditional (ternary) operator (? :)

# List rendering

# Dynamic Tag

# Implicit state sharing

Vue - Provide inject (opens new window)

Passing data deeply with Context (opens new window)

# Event Handling

https://medium.com/swlh/react-vs-vue-event-handling-cb4327242f50

# Slots

best-way-to-change-vue-slots-pattern-into-react (opens new window)

# Class & Style bindings

  • inline styles
  • global css file
  • sass/scss
  • css modules
  • css in js

# Functional Components

...

# Wrapping UI Javascript libraries

https://victorheid.codes/blog/javascript-libraries-with-vue-3/

https://dev.to/this-is-learning/wrapping-library-in-a-react-hook-193e