jeudi 8 juillet 2021

Change from a starting.tsx file a property inside the style.css file or a variable in another tsx file using some sort of global variable or props?

As per title is that achievable? I have the following scenario fileList.tsx: code + 1st global checkbox file2.tsx:logic to display each checkbox in a sort of list style.css

In fileList.tsx I can trigger this global checkbox and my goal is to check also che other checkboxes changing the variable.Or in alternative if I can act inside the style.css to hide them or other things. Is that possible with a sort of global variable or with props?

fileList.tsx

      function handleChange() {some logic here when is checked trigger other 
     checkbox in file2.tsx}
      ...
     <div className="checkbox">
        {" "}
        <input type="checkbox" checked={checked} onChange={handleChange} />
      </div>

file2.tsx ->same as file 1 basically but have the css class inside the file itself

    div className={classes.checkBoxClass}>
            {" "}
            <input
              type="checkbox"
              checked={checked}
              onChange={handleChange}
            />
          </div>
     const useStyles =....checkBoxClass:{...}



Aucun commentaire:

Enregistrer un commentaire