Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: #59

Open
1 task done
meersel opened this issue Jul 14, 2024 · 0 comments
Open
1 task done

[Bug]: #59

meersel opened this issue Jul 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@meersel
Copy link

meersel commented Jul 14, 2024

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

@meersel meersel added the bug Something isn't working label Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant