Skip to content

Commit 6e5af9d

Browse files
committed
Added some comments about flattenedSubscription
1 parent 093d760 commit 6e5af9d

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/ReactFinalForm.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ const ReactFinalForm = ({
7979
}
8080
)
8181

82+
// ⚠️ flattenedSubscription is probably not "hook-safe".
83+
// In the future, changing subscriptions on the fly should be banned. ⚠️
8284
const flattenedSubscription = flattenSubscription(subscription || all)
8385
React.useEffect(() => {
8486
// We have rendered, so all fields are no registered, so we can unpause validation

src/useField.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,9 @@ const useField = (
6767
}
6868
)
6969

70+
// ⚠️ flattenedSubscription is probably not "hook-safe".
71+
// In the future, changing subscriptions on the fly should be banned. ⚠️
7072
const flattenedSubscription = flattenSubscription(subscription || all)
71-
// useDependenciesDebugger({
72-
// name,
73-
// defaultValue,
74-
// validate,
75-
// initialValue,
76-
// isEqual,
77-
// validateFields,
78-
// form
79-
// })
8073
React.useEffect(
8174
() =>
8275
register(state => {

src/useFormState.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const useFormState = ({
2727
}
2828
)
2929

30+
// ⚠️ flattenedSubscription is probably not "hook-safe".
31+
// In the future, changing subscriptions on the fly should be banned. ⚠️
3032
const flattenedSubscription = flattenSubscription(subscription || all)
3133
React.useEffect(
3234
() =>

0 commit comments

Comments
 (0)