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
I can not run the following example code in notebook 6.5.4
importsolara# Declare reactive variables at the top level. Components using these variables# will be re-executed when their values change.sentence=solara.reactive("Solara makes our team more productive.")
word_limit=solara.reactive(10)
@solara.componentdefPage():
# Calculate word_count within the component to ensure re-execution when reactive variables change.word_count=len(sentence.value.split())
solara.SliderInt("Word limit", value=word_limit, min=2, max=20)
solara.InputText(label="Your sentence", value=sentence, continuous_update=True)
# Display messages based on the current word count and word limit.ifword_count>=int(word_limit.value):
solara.Error(f"With {word_count} words, you passed the word limit of {word_limit.value}.")
elifword_count>=int(0.8*word_limit.value):
solara.Warning(f"With {word_count} words, you are close to the word limit of {word_limit.value}.")
else:
solara.Success("Great short writing!")
# The following line is required only when running the code in a Jupyter notebook:Page()
Does this only work for jupyter lab? (notebook v7 is jupyter lab also)
The text was updated successfully, but these errors were encountered:
Have you tried clearing cache and refreshing? If this does not fix the issue, could you take a look at the browser console and sharing the error(s) displayed there?
I can not run the following example code in notebook 6.5.4
Does this only work for jupyter lab? (notebook v7 is jupyter lab also)
The text was updated successfully, but these errors were encountered: