To give you an idea: Making a Future-Proof React Widget | Mendix
It is always a good idea to widen your programming skills with another language. JS is handy when you want to make very smooth transitions or widgets that are not yet offered by the mendix appstore. Java is handy if you find yourself limited by the microflow possibilities (complex calculations/algotithms or do things with the mendix core). But keep in mind that if you make your own widgets and java actions, you are the only one who can maintain them. A lot of mendix developers do not know these languages, therefore you create a risk for your customer, that if you leave the project, no-one will know what goes on in these widgets. These widgets or javaactions will be depricated after sometime (updates) and then the application will break and there will be no-one to resolve it. Therefore it is advised to use as less as possible of these custom, selfbuilt widgets or java actions. If it is possible to build it with mendix. you should do it in mendix.