I faced the same error as @Attila Gyén with the icon field when using the ToggleMask, but there's another way to solve the same thing without going directly to the .p-icon-field class by using the passthrough options offered by primereact:
<Password
pt={{
iconField: {
root: {
style: { width: "100%" },
},
},
input: {
style: { width: "100%" },
},
root: {
style: { width: "100%" },
},
}}
/>
Remember this code my seem complex, but it lets you customize the classes already given by primereact in your JSX / TSX side of the code.