The type of the data in Data
state.
The type of optional parameters.
A React node representing the rendered Resource state.
const MyData: React.FC<DataProps<number, { id: string }>> = ({ value, params }) => <p>Data: {value}</p>;
const MyQuery: React.FC<QueryProps<number, { id: string }>> = () => <p>Loading...</p>;
const MyEmpty: React.FC<EmptyProps<number, { id: string }>> = () => <p>Empty</p>;
const MyFailure: React.FC<FailureProps<number, { id: string }>> = ({ messages }) => <p>Errors: {messages.join(', ')}</p>;
const resource = Resource.Data(42, { id: 'test' });
<ResourceRender
resource={resource}
Data={MyData}
Query={MyQuery}
Empty={MyEmpty}
Failure={MyFailure}
commonProps={{ className: 'resource' }}
matchingProps={{ Data: { style: { color: 'blue' } } }}
/>
A component that renders a Resource ADT by matching its state to provided Data, Query, Empty, or Failure components. Supports merging common and state-specific props for flexible rendering.