Getting props in...
Svelte syntax for getting prop can be kinda confusive. Svelte uses the export term but we are importing some prop...
Vue has his own object method defineProps and React read them through the props object.
Check it out 🚀
React
const Component = (props) => {
return props.msg
}
Vue
const props = defineProps({
msg: String
})
<template>{{ msg }}</template>
Svelte
<script>
export let msg = '';
<script>
{msg}
Top comments (0)