You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,6 +183,34 @@ def example(request):
183
183
184
184
In the example above, the `data1`, and `data2` props will be fetched in one request, while the `data` prop will be fetched in a separate request in parallel. Group names are arbitrary strings and can be anything you choose.
185
185
186
+
### Merge Props
187
+
188
+
By default, Inertia overwrites props with the same name when reloading a page. However, there are instances, such as pagination or infinite scrolling, where that is not the desired behavior. In these cases, you can merge props instead of overwriting them.
189
+
190
+
```python
191
+
from inertia import merge, inertia
192
+
193
+
@inertia('ExampleComponent')
194
+
defexample(request):
195
+
return {
196
+
'name': lambda: 'Brandon',
197
+
'data': merge(Paginator(objects, 3)),
198
+
}
199
+
```
200
+
201
+
You can also combine deferred props with mergeable props to defer the loading of the prop and ultimately mark it as mergeable once it's loaded.
0 commit comments