#react #web #ui #js

react-sys

React bindings for rust

21 releases

1.0.0-alpha.23 Feb 22, 2022
1.0.0-alpha.22 Feb 12, 2022
1.0.0-alpha.20 Jan 26, 2022
1.0.0-alpha.17 Nov 24, 2021

#980 in WebAssembly

Download history 16/week @ 2023-10-19 47/week @ 2023-10-26 21/week @ 2023-11-02 32/week @ 2023-11-09 17/week @ 2023-11-16 37/week @ 2023-11-23 73/week @ 2023-11-30 34/week @ 2023-12-07 35/week @ 2023-12-14 53/week @ 2023-12-21 9/week @ 2023-12-28 33/week @ 2024-01-04 13/week @ 2024-01-11 31/week @ 2024-01-18 31/week @ 2024-01-25 26/week @ 2024-02-01

104 downloads per month
Used in 3 crates (via react-rs)

MIT license

19KB
389 lines

react-sys

Crates.io docs.rs GitHub license GitHub stars

Rust bindings for React.

Install

Cargo.toml

react-sys = "1.0.0-alpha.11"

Though the version is at 1.x-alpha, this crate is NOT ready for production and under heavy development. This crate is used by frender, which provides a friendly and safe api to use React in rust.

TODO

  • Hooks

    • React.useState

    • React.useRef

    • React.useEffect unsafe

    • React.useContext

    • useLayoutEffect

    • Can we implement the following hooks in rust ?

      • React.useMemo

      • React.useCallback

        Maybe we should implement a use_closure hook in rust.

    • Do we need the following hooks in rust ?

      • React.useReducer
      • React.useImperativeHandle
      • useDebugValue
  • ErrorBoundary

  • React.memo

  • Component

    • html
    • functional component with hooks
  • Element

    • React.createElement
    • React.Element cast between js and rust wasm
    • jsx like syntax to create element

Dependencies

~6.5–9MB
~171K SLoC