RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/room/composer/messageBox/hooks/useMessageBoxAutoFocus.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function useMessageBoxAutoFocus has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useMessageBoxAutoFocus = (enabled: boolean): Ref<HTMLElement> => {
    const ref = useRef<HTMLElement>();

    useEffect(() => {
        const handleKeyDown = (e: KeyboardEvent) => {

    Avoid too many return statements within this function.
    Open

                    return;

      There are no issues that match your filters.

      Category
      Status