Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@che-ins/form
Advanced tools
Readme
Компоненты
Для работы необходимо добавить reducer
{ [FORMS_STATE_NAMESPACE]: formsReducer }
Form принимает formName, и в redux работает с объектом
<Form formName={BASE_FORM_NAME}>
{form}
</Form>
В большинстве случаев для использования компонентов ввода необходимо использовать HOC
Пропсы component
и field
обязательны, все остальные передаются к компоненту который передали
component
- компонентfield
- путь до изменяемого поля в моделиКомпонент всегда должен первым аргументом в функцию onChange
передавать новое значение
<FormField
component={Input}
field={'firstname'}
placeholder="Ivan"
label="Firstname"
/>
field
во всех actons и selectors - пусть в строковом представлении до поля через точку,
prop.prop1.prop2[arrayIndex][arrayIndex2].prop3 = 'some value'
Ошибки показываются только полей на которых что либо вводили, т.н. toched, для того что бы избежать показа ошибок незаполненных полей на всей форме когда её только начали заполнять
Для переопределения этого поведения для конкретного поля необходимо сделать это поле touched в необходимый момент
dispatch(
formActions.setFieldTouched({
formName: formName,
field: fieldName,
isTouched: true,
})
)
Для показа всех ошибок на форме существует флаг isShowAllErrors. Его простановка необходима вручную.
dispatch(
formActions.setIsShowAllErrors({
formName: formName,
isShow: true,
})
)
Основной кейс использования - перед отправкой на сервер включить показ всех ошибок на форме setIsShowAllErrors и отвалидировать её, показав все ошибки
FAQs
<>
We found that @che-ins/form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.