react-intl-hooks
react-intl-hooks copied to clipboard
Simplify
Hello, just checking code and why not to simple return function from hook? like this
import { useIntl } from 'react-intl';
const useFormatMessage = () => {
const { formatMessage } = useIntl();
return formatMessage;
};
export default useFormatMessage;
Hey!
I think because the types wouldn't show up when you use the library. I'm open to find a better solution for it!
@MateoKruk formatMessage is typed, so it will just return that type, no need to create wrapper or re-type it

@Kepro oh, that's great! Maybe I over engineered the first version of the library. Are interested in implementing this change?
can do! :)