--- layout: default title: "The ReferenceNodeInput Component" --- # `` Component This [Enterprise Edition](https://react-admin-ee.marmelab.com)React Admin Enterprise Edition icon component allows users to select one or several nodes from a tree of a reference resource. For instance, this is useful to select a category for a product. ## Usage Use `` in a react-admin form, and set the `reference` and `source` props just like for a ``. ```tsx import { Edit, SimpleForm, TextInput } from 'react-admin'; import { ReferenceNodeInput } from '@react-admin/ra-tree'; const ProductEdit = () => ( ); ``` `` is a controller component, i.e. it fetches the tree from the reference resource, creates a tree choices context, and renders its child component. By default `` will render a simple [``](./TreeInput.md) as its child. If you need to customize the `` props, e.g. set the `multiple` prop, you will need to pass the child explicitly: ```tsx import { Edit, SimpleForm, TextInput } from 'react-admin'; import { ReferenceNodeInput, TreeInput } from '@react-admin/ra-tree'; const ProductEdit = () => ( ); ``` ## Props | Prop | Required | Type | Default | Description | | ----------------- | ------------ | ---------------- | --------------- | ----------------------------------------------------------------------------------------- | | `reference` | Required | string | - | The reference resource | | `source` | Required | string | - | The name of the source field | | `children` | Optional | React Element | `` | The child component responsible for rendering the input | | `meta` | Optional | object | - | An object containing metadata to be passed when calling the dataProvider | ## `children` `` accepts only one child, which is responsible for rendering the input. By default, it renders a simple `` with no props. If you need to pass additional props to ``, you will need to pass them explicitely: ```tsx ``` ## `meta` Use the `meta` prop to pass metadata to the dataProvider when calling `getTree()`: {% raw %} ```tsx ``` {% endraw %} ## `reference` Use the `reference` prop to specify the reference resource: ```tsx ``` ## `source` Use the `source` prop to specify the name of the source field: ```tsx ```