Answer the question
In order to leave comments, you need to log in
How to make a dynamic class using modules?
import React, { useRef, useState } from 'react';
import style from '../styles/modules/form.module.scss';
const Form = () => {
let name_wrap = useRef();
let name_input = useRef();
let [nputStatus, setInputStatus] = useState('test');
return (
<form className={style.form}>
<span className={style.title}>Lorem ipsum dolor sit amet.?</span>
<span
className={style.answer}
>Lorem ipsum dolor sit.</span>
<div ref={name_wrap} className={`${style.input_wrap} ${inputStatus}`}>
<input
onFocus={()=>{inputFocus();}}
onBlur={()=>{inputBlur();}}
ref={name_input}
type="text"
placeholder='*Name'
/>
</form>
)
}
export default Form
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question