Nucleic Photon Magnetizer

    react-relay
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-relay package

    14.1.0 • Public • Published

    React APIs for Relay

    This package contains a collection of React APIs: Hooks and Components that are integrated with Relay runtime.

    Example:

    // @flow
    
    import type {UserComponent_user$key} from 'UserComponent_user.graphql';
    
    const React = require('react');
    
    const {graphql, useFragment} = require('react-relay');
    
    type Props = {
      user: UserComponent_user$key,
    };
    
    function UserComponent(props: Props) {
      const data = useFragment(
        graphql`
          fragment UserComponent_user on User {
            name
            profile_picture(scale: 2) {
              uri
            }
          }
        `,
        props.user,
      );
    
      return (
        <>
          <h1>{data.name}</h1>
          <div>
            <img src={data.profile_picture?.uri} />
          </div>
        </>
      );
    }

    For complete API reference, visit https://relay.dev/.

    Install

    npm i react-relay

    Homepage

    relay.dev

    DownloadsWeekly Downloads

    147,233

    Version

    14.1.0

    License

    MIT

    Unpacked Size

    1.19 MB

    Total Files

    194

    Last publish

    Collaborators

    • alunyov
    • rbalicki
    • sugarpirate
    • fb
    • yuzhi
    • josephsavona
    • kassens
    • xiaobu
    • lunaruan
    • relay-bot
    • kacieb