Answer the question
In order to leave comments, you need to log in
How to write scripts using React?
Hello. Sorry if this is a dumb question, but I really don't understand.
I'm doing a project on React and found this interesting form for a bank card: https://devtutor.ru/veb-razrabotki/formy/adaptivna...
I decided to make one in my project, but I don't understand a few things
: for it you need to make a separate component. And where to paint the logic? In a jsx file or create a separate js file purely for the script of this form?
2) How can I get HTML elements by selectors in JS if I use css modules? After all, the class name will always be with some characters at the end
3) To work, you need to include imask.js. And where to connect it? Obviously not with the script tag in index.html
Answer the question
In order to leave comments, you need to log in
1) write in jsx. This is what React was created for
2) you can assign a regular class to elements. It's done like this . And use selector with class
3) in component className={`${styles.input} name-input`}
name-input
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question