
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@flowerforce/flower-react-form
Advanced tools
Flower React Form is a form management library for React. Built on top of Flower Core, it can be easily integrated with FlowerReact or used independently while preserving Flower’s key features, such as render optimization, automatic data handling, and validation rule management.
For more info flowerjs.it/
Flower React Form can be installed via npm or yarn for use in any JavaScript project.
#NPM
npm install @flowerforce/flower-react-form
#YARN
yarn add @flowerforce/flower-react-form
The FormProvider component wraps the entire application, providing a global context for managing the application flow.
import React from 'react'
import { FormProvider } from '@flowerforce/flower-react-form'
function Root() {
return (
<FormProvider>
<App />
</FormProvider>
)
}
FormProvider accepts some properties such as
reducers
andconfigureStoreOptions
in order to inject custom reducers into redux instance provided by FlowerProvider component. N.B.: actions and selectors from your custom reducers must useuseSelector
anduseDispatch
provided by flower-react-form
import React from 'react'
import { customReducer, customReducer2 } from 'my-custom-reducers'
import { FormProvider } from '@flowerforce/flower-react-form'
const reducers = {
customReducer: customReducer.reducer,
customReducer2: customReducer2.reducer
}
function Root() {
return (
<FormProvider reducers={reducers}>
<App />
</FormProvider>
)
}
The FlowerForm component defines a form with a specific name, which serves as a unique identifier for the form. It is the main component for defining forms, accepting a required "name" property and an initialState field for prepopulating values.
import React from 'react'
import { FlowerForm, FlowerField } from '@flowerforce/flower-react-form'
export const Page = () => {
<FlowerForm
name="form-test"
initialState={{ name: 'andrea', surname: 'rossi' }}
>
<FlowerField
id="name"
validate={[
{
message: 'is equal',
rules: { $and: [{ name: { $eq: 'andrea' } }] }
}
]}
>
your input component...
</FlowerField>
<FlowerField
id="surname"
validate={[
{
message: 'is equal',
rules: { $and: [{ surname: { $eq: 'rossi' } }] }
}
]}
>
your input component...
</FlowerField>
</FlowerForm>
}
Edit on [codesandbox/](add link)
Here, we are using the useFlower hook to obtain some essential functions for navigation and handling of the application flow.
import React from 'react'
import { FlowerForm, FlowerField } from '@flowerforce/flower-react-form'
const ViewFormState = () => {
const { isValid, getData, setData, ...rest } = useFlowerForm()
return <span>{isValid}</span>
}
export const Page = () => {
<FlowerForm
name="form-test"
initialState={{ name: 'andrea', surname: 'rossi' }}
>
<FlowerField
id="name"
validate={[
{
message: 'is equal',
rules: { $and: [{ name: { $eq: 'andrea' } }] }
}
]}
>
your input component...
</FlowerField>
<FlowerField
id="surname"
validate={[
{
message: 'is equal',
rules: { $and: [{ surname: { $eq: 'rossi' } }] }
}
]}
>
your input component...
</FlowerField>
<ViewFormState />
</FlowerForm>
}
Edit on [codesandbox/](add link)
import React from 'react'
import { FlowerForm, FlowerField } from '@flowerforce/flower-react-form'
export const Page = () => {
const { isValid, getData, setData, ...rest } = useFlowerForm('form-test')
return (
<FlowerForm
name="form-test"
initialState={{ name: 'andrea', surname: 'rossi' }}
>
<FlowerField
id="name"
validate={[
{
message: 'is equal',
rules: { $and: [{ name: { $eq: 'andrea' } }] }
}
]}
>
your input component...
</FlowerField>
<FlowerField
id="surname"
validate={[
{
message: 'is equal',
rules: { $and: [{ surname: { $eq: 'rossi' } }] }
}
]}
>
your input component...
</FlowerField>
<ViewFormState />
</FlowerForm>
)
}
Edit on [codesandbox/](add link)
The Flower React docs are published at flowerjs.it/
FAQs
FlowerJS utils for Form handling.
The npm package @flowerforce/flower-react-form receives a total of 30 weekly downloads. As such, @flowerforce/flower-react-form popularity was classified as not popular.
We found that @flowerforce/flower-react-form demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.