0

I am new to React Js. I have some normal javascript codes for frequently used calculations and etc and it has lots of javascript codes.

Now i am moving to React Components and like to use same codes which i have written in plain javascript in my react components instead of re-writing everything.

Kindly help me on this.

1 Answer 1

1

Think of creating a util/ or lib/ folder on the root of your project. You can export those functions etc and use anywhere as you would normally.

There is nothing related to react, except you shoudn t try to update the dom via plain JS. Shortly, let react do what it does, elsewhere use your own util, lib helpers without issues.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your reply. @FurkanO. What should i do if plain JS updates the dom?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.