We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just spend the whole day trying to figure out why simple Flow generic code does not work.
Leaving it here, in order to help the future me or anyone else.
Flow cannot say in humanly comprehensible language that generic type needs to be bounded. https://flow.org/en/docs/types/generics/#toc-generic-types-act-as-bounds
Still, don't understand why Flow needs it and what actually fixes it.
The text was updated successfully, but these errors were encountered:
: Object!
: Object
export default function useMutation<Mutation: Object, Name>( config: Config, validate?: (Input<Mutation>) => Errors<Mutation, Name>, ): [Commit<Mutation>, Errors<Mutation, Name>] { const [errors, setErrors] = useState<Errors<Mutation, Name>>(null); const environment = useRelayEnvironment(); function commit(input) { if (validate) { const errors = validate(input); setErrors(errors); } } return [commit, errors]; }
Sorry, something went wrong.
No branches or pull requests
Just spend the whole day trying to figure out why simple Flow generic code does not work.
Leaving it here, in order to help the future me or anyone else.
Flow cannot say in humanly comprehensible language that generic type needs to be bounded. https://flow.org/en/docs/types/generics/#toc-generic-types-act-as-bounds
Still, don't understand why Flow needs it and what actually fixes it.
The text was updated successfully, but these errors were encountered: