react-strict-dom

0.0.34 • Public • Published

react-strict-dom

GitHub license npm version

web (prod) web (dev) native

React Strict DOM (RSD) standardizes the development of styled React components for web and native. The goal of RSD is to improve the speed and efficiency of React development without compromising on performance, reliability, or quality. Building with RSD is helping teams at Meta ship features faster, to more platforms, with fewer engineers.

Documentation

Please refer to the React Strict DOM website for detailed documentation. The API section includes detailed compatibility tables for native. Please read the linked issues for details on the most significant issues, and register your interest (e.g., thumbsup reaction) in supporting these features on native platforms.

Example

Styles are passed to elements using the style prop. The style prop accepts an array of static and dynamic styles.

import { css, html } from 'react-strict-dom';

const styles = css.create({
  root: {
    marginBlock: '1rem'
  },
  cond: {
    borderWidth: '5px'
  },
  opacity: (value) => ({
    opacity: value
  })
})

export default function App(props) {
  const opacity = useOpacity();
  return (
    <html.div
      {...props}
      style={[
        styles.root,
        cond && styles.cond,
        styles.opacity(opacity)
      ]}
    />
  );
}

License

React Strict DOM is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i react-strict-dom

Weekly Downloads

6,467

Version

0.0.34

License

MIT

Unpacked Size

284 kB

Total Files

139

Last publish

Collaborators

  • necolas