How do I execute javascript after the component in rendered? #1600
Unanswered
imanpalsingh
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi ! I'm currently exploring view component and I wanted to know how do I run the JavaScript associated with a component after it is rendered?
My component structure looks like this
The JavaScript in
select_compnent.js
is executed before the component is rendered. Is it possible to execute it only on render?I have set up the javascript component files by following the doc here https://viewcomponent.org/guide/javascript_and_css.html#javascript-and-css
Follow up - If this is possible, is it possible to share values from the
component.rb
tocomponent.js
?Beta Was this translation helpful? Give feedback.
All reactions