News for hackers. Stuff that matters.
Re:Show HN: Fate, a new data framework for React and tRPC, i... by cpojer on Wednesday December 10, 2025 @09:04AM (#46217825)
You don't have to rename the variable. You can also do this:

```

export function PostCard(props: { post: ViewRef<'Post'> }) {

  const post = useView(PostView, props.post);
}

```

If you add a few aliases (that can be easily generated), it becomes this:

```

export function PostCard(props: { post: PostViewRef }) {

  const post = useView(PostView, props.post);
}

```

There are many bits in fate worthy of criticism. Naming and typing React props really isn't one of those.

There are no comments on this comment yet.