Please see this two minimum example of React and Vue
They all have an <input />, and bind the input value to the state.
React
import React from "react";
export default function App() {
const [value] = React.useState("Hello World");
return (
<div>
<input value={value} />
</div>
);
}
Vue
<template>
<div>
<input :value="value" />
</div>
</template>
<script>
export default {
data() {
return {
value: "Hello World",
};
},
};
</script>
If you type something into React's version input, nothing will happen.
I can understand this part because the state isn't changing, so the input value isn't changing also.
However, if you type something into Vue's version input, you can now alter the input value.
Why is this happening?