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
if item_query.loading:
rendered_items = html.h2("Loading...")
elif item_query.error or not item_query.data:
rendered_items = html.h2("Error when loading!")
else:
rendered_items = html.ul([html.li(item, key=item) for item in item_query.data])
return html.div("Rendered items: ", rendered_items)
The above is the code snippet on use_query, it keeps writing loading... when used on my model.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
from example.models import TodoItem
from reactpy import component, html
from reactpy_django.hooks import use_query
def get_items():
return TodoItem.objects.all()
@component
def todo_list():
item_query = use_query(get_items)
The above is the code snippet on use_query, it keeps writing loading... when used on my model.
Beta Was this translation helpful? Give feedback.
All reactions