Make error typing accepting null

Hello,

A lot of libraries, including the popular RVF (https://www.rvf-js.io/) tend to return null or string for error. All Polaris form only accepts string or undefined in the typing for error, which causes annoying type errors. Would it be possible for error to also accept null?

Thanks

Can you give an example of what you’re asking for? I want to make sure I understand it.

Thanks!

Sure! Basically, the library RVF for instance has a feature that returns the error for a field:

<s-text-field error={ form.error('my-field') }></s-text-field>

This library returns a string or null (for no error), but Polaris components only accept string or undefined, so I get a typing issue. I wonder if the typing could be slightly loosen on Polaris to also accept null, this seems like a sufficiently widespread use case to be considered :slight_smile: