How to use the @webiny/app-i18n/hooks/useI18N.useI18N function in @webiny/app-i18n

To help you get started, we’ve selected a few @webiny/app-i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages / app-forms / src / admin / components / FormEditor / Tabs / EditTab / EditTab.js View on Github external
insertField,
        updateField,
        deleteField,
        data,
        moveField,
        moveRow,
        getFieldPlugin
    } = useFormEditor();
    const [editingField, setEditingField] = useState(null);
    const [dropTarget, setDropTarget]: [FieldLayoutPositionType, Function] = useState(null);

    const editField = useCallback(field => {
        setEditingField(cloneDeep(field));
    });

    const i18n = useI18N();

    const handleDropField = useCallback((source, dropTarget) => {
        const { pos, name, ui } = source;

        if (name === "custom") {
            editField({});
            setDropTarget(dropTarget);
            return;
        }

        if (ui === "row") {
            // Reorder rows.
            // Reorder logic is different depending on the source and target position.
            return moveRow(pos.row, dropTarget.row);
        }

@webiny/app-i18n

[![](https://img.shields.io/npm/dw/@webiny/app-i18n.svg)](https://www.npmjs.com/package/@webiny/app-i18n) [![](https://img.shields.io/npm/v/@webiny/app-i18n.svg)](https://www.npmjs.com/package/@webiny/app-i18n) [![code style: prettier](https://img.shield

MIT
Latest version published 2 days ago

Package Health Score

78 / 100
Full package analysis

Similar packages