Skip to content

Commit

Permalink
feat(settings): support effects props
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Aug 24, 2021
1 parent 0e1fcd4 commit e221142
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/react-settings-form/src/SettingsForm.tsx
Expand Up @@ -38,9 +38,10 @@ export const SettingsForm: React.FC<ISettingFormProps> = observer(
const form = useMemo(() => {
return createForm({
values: node?.props,
effects() {
effects(form) {
useLocales(schema?.['$namespace'])
useSnapshot(operation)
props.effects?.(form)
},
})
}, [node, node?.props, schema, operation])
Expand Down
3 changes: 2 additions & 1 deletion packages/react-settings-form/src/types.ts
@@ -1,9 +1,10 @@
import React from 'react'

import { Form } from '@formily/core'
export interface ISettingFormProps {
className?: string
style?: React.CSSProperties
uploadAction?: string
components?: Record<string, React.FC<any>>
effects?: (form: Form) => void
scope?: any
}

0 comments on commit e221142

Please sign in to comment.