Skip to content

Commit

Permalink
Make required props error more helpful
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Sep 20, 2024
1 parent 7e7dda5 commit e7c8430
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/component_declaration/builder_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,13 @@ class MissingRequiredPropsError extends Error {

MissingRequiredPropsError(this._message);

static const _messageSuffix = ' Ensure this prop is either directly set, or indirectly set via prop forwarding.'
'If this error seems unexpected and this component uses connect or mixes in required props from another component,'
' please refer to the null safety migration guide for instructions on how to proceed:'
' https://github.com/Workiva/over_react/blob/master/doc/null_safety/null_safe_migration.md#wrapper-and-connected-components-and-required-props';

@override
String toString() => 'RequiredPropsError: $_message';
String toString() => 'RequiredPropsError: $_message$_messageSuffix';
}

/// Helper static extension methods to make forwarding props easier.
Expand Down

0 comments on commit e7c8430

Please sign in to comment.