Relay Hooks is a set of new Hooks-based APIs for using Relay with React that improves upon the existing container-based APIs.
In this we will cover how to start using Relay Hooks, what you need to know about compatibility, and how to migrate existing container-based code to Hooks if you choose to do so. However, note that migrating existing code to Relay Hooks is not required, and container-based code will continue to work.
Make sure the latest versions of React and Relay are installed, and that you’ve followed additional setup in our Installation & Setup guide:
Then, you can import Relay Hooks from the
react-relay module, or if you only want to include Relay Hooks in your bundle, you can import them from
Check out the following guides in this section: