EDS4 logo
@eds/notice
v5.0.3

Notice

Used to highlight pertinent information.

description has now been deprecated.

Passing in content as children will now display in the place that originally displayed the description.

How to upgrade:

Copy the text value of the description prop, wrap it inside a <Text> component and put it inside the <Notice> component

<Notice
// description="The text" <--- This is no longer needed
>
{/* description is now passed in as children */}
<Text>The text</Text>
</Notice>

primaryAction, primaryActionLabel, secondaryAction, secondaryActionLabel has now been deprecated.

These props have now been replaced with the actions prop. The actions prop can either take in a single action object or an array of maximum two actions.

How to upgrade:

  • The primaryAction is now the onClick property of the first object inside the actions array
  • The primaryActionLabel is now the label property of the first object inside the actions array
  • The secondaryAction is now the onClick property of the second object inside the actions array
  • The secondaryActionLabel is now the label property of the second object inside the actions array
<Notice
// primaryAction={() => { alert('do something') }}
// primaryActionLabel="Primary action"
// secondaryAction={() => { alert('do something 2') }}
// secondaryActionLabel="Secondary action"
actions={[
{
label: 'Primary action',
onClick: () => {
alert('do something');
},
},
{
label: 'Secondary action',
onClick: () => {
alert('do something 2');
},
},
]}
>
<Text>Some text</Text>
</Notice>