Closed imnash21 closed 7 months ago
@Rekl0w i fixed this the right way by removing those two PT props. If you want to use invalid in PT you would use the props.invalid
on the input
PT object
@melloware You deleted it from pt options but now there is no explanation for invalid at props too. I can add to there.
OH those props were just in the wrong place. I will fix.
They were in PT when they should have been in main props.
Okay but he mentioned that if he calls directly invalid, it gets error. That's why i added invalid={true}
yeah but that is not correct. here is the proper way to use invalid with Passthrough.
https://stackblitz.com/edit/xmhzeu?file=src%2FApp.jsx
<Password
invalid
pt={{
input: ({ props }) => {
if (props.invalid) return 'invalid-css-class';
},
}}
/>
that will add the invalid-css-class
to the Password only if its invalid.
Thank you for responses, now I can continue to work and test it.
Describe the bug
In the Features Tab you can see the invalid prop can call directly but not, when I read the API Tab you can call the "invalid" inside pt prop. That's why I got an error everytime I call "invalid" directly.
Reproducer
No response
PrimeReact version
10.6.3
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response