refactor: rename context_data field to template_data (#1162)

This commit is contained in:
Juro Oravec 2025-05-04 01:49:54 +02:00 committed by GitHub
parent 28b61c1609
commit d4d834256a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 33 additions and 4 deletions

View file

@ -61,9 +61,10 @@ name | type | description
`component` | [`Component`](../api#django_components.Component) | The Component instance that is being rendered
`component_cls` | [`Type[Component]`](../api#django_components.Component) | The Component class
`component_id` | `str` | The unique identifier for this component instance
`context_data` | `Dict` | Dictionary of context data from `Component.get_context_data()`
`context_data` | `Dict` | Deprecated. Use `template_data` instead. Will be removed in v1.0.
`css_data` | `Dict` | Dictionary of CSS data from `Component.get_css_data()`
`js_data` | `Dict` | Dictionary of JavaScript data from `Component.get_js_data()`
`template_data` | `Dict` | Dictionary of template data from `Component.get_template_data()`
::: django_components.extension.ComponentExtension.on_component_input
options:

View file

@ -67,7 +67,7 @@ If you insert this tag multiple times, ALL JS scripts will be duplicately insert
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L2772" target="_blank">See source code</a>
<a href="https://github.com/django-components/django-components/tree/master/src/django_components/templatetags/component_tags.py#L2791" target="_blank">See source code</a>