• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Disabling the continue button when there is no selection from the table

Resolved: Disabling the continue button when there is no selection from the table

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have a list from backend. This list is displaying the user’s invoices. I want the button to be disabled if the user doesn’t select at least one invoice. If the user selects at least 1 invoice, I want the button to be active. But the invoices and the button are in different components.
payment-table.js

Here the IDE warns me like this; ‘setEnabledButton’ is assigned a value but never used.


policy-payment-info.js

Answer:

First set default state for your useState function :
After this you need to execute the seState by add ()
Like this :
And then, you need to use this state to enable or disable the button :

If you have better answer, please add a comment about this, thank you!

javascript react-native reactjs
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: When converting markdown to latex with pandoc, how can I end a block before the next heading?

26/03/2023

Resolved: TYPO3 SQL error: Field ‘tx_imagezoom_set’ doesn’t have a default value

26/03/2023

Resolved: std::regex_replace to replace multiple combinations

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.