Errors

If you want to uniformly render all action errors of the application, there is a useErrors hook to access all the errors.

import { useErrors } from 'react-sprout';

function App() {
	let [errors, dismiss] = useErrors();

	return (
		<>
			{errors.map((error, index) => (
				<Error key={index} onDismiss={() => dismiss(error)}>
					{error.message}
				</Error>
			))}
			...
		</>
	);
}