bfanger / svelte-preprocess-react

Seamlessly use React components inside a Svelte app
MIT License
126 stars 6 forks source link

Binding issue #22

Closed Kax675 closed 1 year ago

Kax675 commented 1 year ago

I don't need to talk too much, the bindings don't work. Anyone know the solution for this?

image image

bfanger commented 1 year ago

React doesn't have two-way data binding. Use the classic React way of updating the value using the onChange:

<script lang="ts">
  import { Input, Text } from "@geist-ui/core";

  let value = "";
</script>

<react:Input {value} on:change={(e) => { value = e.target.value }} />
<react:Text>{value}</react:Text>