# Configuring Property Capture

Freshpaint comes configured with an initial set of prop-capture configurations for commonly used components. If you would like to capture a non-default property, this can be achieved by adding a small piece of configuration code to the app.

Freshpaint will check for a `freshpaintOptions` property that contains a set of properties to include or exclude. See below for the structure of the property:

```
freshpaintOptions = {
    eventProps: {
    include: [ '<inc_prop_1>', '<inc_prop_2>', ..., '<inc_prop_n>' ],
    exclude: [ '<exc_prop_1>', '<exc_prop_2>', ..., '<exc_prop_n>' ],
    }
}
```

The properties listed in the `include` list will be included in the event. The properties in the `exclude` list will be excluded from the event if they would have otherwise been included by either the `include` list or as a [built-in property](https://documentation.freshpaint.io/faqs/what-data-does-freshpaint-collect/data-collected-on-react-native#attributes-captured-by-default).

**Stateless, Functional Component Example:**

```javascript
import React from 'react';
import { Text, TouchableOpacity, View } from 'react-native';

const ProductItem = ({title, description, onPress}) => {
  return (
      <TouchableOpacity onPress={onPress}>
        <View>
          <Text>{title}</Text>
          <Text>{description}</Text>
        </View>
      </TouchableOpacity>
  );
}

ProductItem.freshpaintOptions = {
  eventProps : { include: [ 'title', 'description' ] }
};

export { ProductItem };
```

**Stateful Component Example:**

```javascript
import React, { Component } from 'react';
import { Text, TouchableOpacity, View } from 'react-native';

export default class ProductItem extends Component {
  freshpaintOptions = {
    eventProps : { include: [ 'title', 'description' ] }
  };    

  render() {
    return (
      <TouchableOpacity onPress={onPress}>
        <View>
          <Text>{title}</Text>
          <Text>{description}</Text>
        </View>
      </TouchableOpacity>
    );
  }
}
```

{% hint style="info" %}
The use of a custom prop configuration will result in additional properties being captured in the `Hierarchy` event property. You can check these out in live view as seen in the screenshot below:
{% endhint %}

<figure><img src="/files/EJVXemgdkXNTwtPvsrJL" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.freshpaint.io/readme/guides/react-native-quickstart-guide/configuring-property-capture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
