-3

I need to insert a JS-script into the React class component and make the script run only at the moment when this component is already mounted and is physically in the DOM. How should I do it? Thank you for attention.

0

1 Answer 1

1

If you need to execute a script or a function once your component is already mounted you should add a componentDidMount in your React class component.

componentDidMount(){}
Sign up to request clarification or add additional context in comments.

2 Comments

And what to write in it?
@Konstantin the JS-script you need

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.