daattali / shinyjs

💡 Easily improve the user experience of your Shiny apps in seconds
https://deanattali.com/shinyjs
Other
734 stars 119 forks source link

renderUI: attempt to apply non-function error with shinyjs2.0 #228

Closed iqbals closed 3 years ago

iqbals commented 3 years ago

I have an error:

Warning: Error in renderUI: attempt to apply non-function
  96: renderUI [/Users/sumaiya/Broad_Work/v2p/App/miscast07302020_replica/miscast07302020_r2/server.R#8281]
  95: func
  82: origRenderFunc
  81: output$msaResearchVSR
   1: shiny::runApp

thrown from following lines in the server.R (line # 8281 is the call to function: shinyjs::js$runMsa, see below)

output$msaResearchVSR <- renderUI({
    gene_wise_info=read_delim(paste("gene_wise_info/",input$reportTgeneSelected,".txt",sep=''), "\t", escape_double = FALSE, trim_ws = TRUE)
    shinyjs::js$runMsa(containerId=msaContainerVSRId, aaInputId="aa_Selected", sequence=paste(gene_wise_info$`Amino Acid`, collapse=""))
  })

The code and my app runs perfectly with shinyjs 1.0, but when I installed shinyjs 2.0, I get this error. Any help will be very much appreciated

daattali commented 3 years ago

Did you notice the breaking change from version 1 to 2, that extendShinyjs() now requires the use of the functions argument? It's possible that you didn't specify runMsa in that argument

iqbals commented 3 years ago

I see. Yes, adding the following line solved it - thank you!

shinyjs::extendShinyjs(text = jscode, functions = c("runMsa"))