What does HackerNews think of valtio?

💊 Valtio makes proxy-state simple for React and Vanilla

Language: TypeScript

#17 in React
I like valtio, works w/ React or just js. Has subscribe, derive, and more.

https://github.com/pmndrs/valtio

Check out valtio if you want to do proxy based state management in react.

https://github.com/pmndrs/valtio

https://codesandbox.io/s/bitter-night-mm4xes?file=/src/App.j...

    // a.js

    import { proxy } from "valtio";

    export const a = proxy([]);
    a.push(1);

    // App.jsx

    import { useSnapshot } from "valtio";
    import { a } from "./a";

    const add = () => a.push(a.length + 1);

    export default function App() {
      const snap = useSnapshot(a);
      return (
        
    {snap.map((value, index) => (
  • {`${index}=>${value}`}
  • ))}
Add element
); }
"UI state knows what its dependencies are automatically and only updates when they change" - you should check out [valtio](https://github.com/pmndrs/valtio).
For another comparison, there's valtio that I learned about from a previous HN discussion: https://github.com/pmndrs/valtio
This is really good feedback.

1. We are going to remove Mobx. It will also reduce the learning curve for our customers. This change won't affect our API and will be fully backward compatible. We are considering Valtio as an alternative [0]. 2. As much as we can help it, we are not going to embed iframes. We'd love to deliver a native, and lean experience. 3. We already provide a network layer library [1] and want to offer more headless components. Can you give us some feedback on what you'd like to see? We are very inspired by Downshift's approach [2].

[0] https://github.com/pmndrs/valtio [1] https://www.npmjs.com/package/@magicbell/core [2] https://github.com/downshift-js/downshift