Rezact / Rezact

A JavaScript Framework/Library (call it what you want) that blends the best of svelte, solid, react, and many others.

Home Page:https://rezact.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signal is not passed properly to the value attribute when passed into a component via props and accessed using dot notation. ie: `props.$value`

zachlankton opened this issue · comments

Describe the bug
Signal is not passed properly to the value attribute when passed into a component via props and accessed using dot notation. ie: props.$value

To Reproduce

function NumInput(props) {
  return <input type="number" value={props.$count} />;
}

export function Page() {
  let $myCount = 10;

  return (
    <>
      <h1>Input Value Attribute Passed with dot notation</h1>
      <NumInput $count={$myCount} />
      <p>{$myCount}</p>
    </>
  );
}

Gets transformed into this:

image

Expected behavior

The .get() call should not be appended to this value... it needs to be passed in as is.

Additional context

This does not happen when the props are destructured like this:

function NumInput2({ $count }) {
  return <input type="number" value={$count} />;
}

The output is correct:

image