What’s a proper way to wire a dishwasher
Ok the GFCI would need to be accessible I usually put them in the cabinet between the sink and dishwasher. (My state did not adopt GFCI for dishwasher so if the customer wants them that’s where I locate them). Romex as the connection is not the correct method. A metal clad or flexible conduit to protect the wiring is the code compliant hard wire method. The Romex can get pinched moving the unit so the Romex stops at the old work box then metal clad to the junction box on the dishwasher. Yes almost everyone has a dishwasher wired this way but an inspector will red tag this. I have been called several times to change wiring like this. Since the dishwashers are fixed in place the max load of 50% of the branch circuit rating. Per NEC 210.23.A.2 so normally a dishwasher gets a dedicated circuit.