-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Guidelines
- I agree to follow this project's Contributing Guidelines.
Project Version
0.2.0
Platform and OS Version
Windows 11
Existing Issues
No response
What happened?
How to use reactable.extras::reactable_extras_server(
id ="test",
data = data_filtered(),
total_pages = 10,
sortable = TRUE),
with a reactive data_filtered() data.frame (table), that only exist after clicking on action button filter_data?
Shiny stopped and produced the following error for the above code:
Warning: Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context.
• You tried to do something that can only be done from inside a reactive consumer.
49:
48: signalCondition
47: signal_abort
46: rlang::abort
45: .getReactiveEnvironment()$currentContext
44: getCurrentContext
43: .dependents$register
42: data_filtered
38: server [C:/Users/meers/Projects/app.R.R#1265]
1: runApp
Error in .getReactiveEnvironment()$currentContext() :
Operation not allowed without an active reactive context.
• You tried to do something that can only be done from inside a reactive consumer.
\
Example of reactive data_filtered():
data_filtered is created when an ActionButton is click:
data_filtered <- shiny::reactive({
data_filtered -< some_dataframe |>
filter(x %in% input$selections)
}) |>
bindEvent(input$filter_data)
Shiny with no error messages: reactable::readerReactable({
req(data_filtered()) /* check is data frame exist */
reactable::reactable(
data = data_filtered(),
...
)
})
Steps to reproduce
1.data_filtered <- shiny::reactive({
data_filtered -< some_dataframe |>
filter(x %in% input$selections)
}) |>
bindEvent(input$filter_data) /* input$filter_data is an Action Button ID */
3.reactable.extras::reactable_extras_server(
id ="test",
data = data_filtered(),
total_pages = 10,
sortable = TRUE)
...
Expected behavior
No error message from Shiny
Attachments
No response
Screenshots or Videos
No response
Additional Information
No response