Skip to content

Commit

Permalink
fix(docs-react): fix eslint errors in Methods
Browse files Browse the repository at this point in the history
Add key prop to ExamplePairings component and remove unnecessary keys from Typography components
  • Loading branch information
BelfordZ committed Nov 29, 2024
1 parent 6cff5a6 commit cf8debc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/docs-react/src/Methods/Methods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class Methods extends Component<IProps> {
)
}>
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
<Typography key={method.name} className={classes.heading}>{method.name}</Typography>
<Typography key={method.summary} className={classes.secondaryHeading}>{method.summary}</Typography>
<Typography className={classes.heading}>{method.name}</Typography>
<Typography className={classes.secondaryHeading}>{method.summary}</Typography>
</ExpansionPanelSummary>

{method.tags && method.tags.length > 0 &&
Expand Down Expand Up @@ -133,6 +133,7 @@ class Methods extends Component<IProps> {
</ExpansionPanelDetails>
}
<ExamplePairings
key="example-pairings"
uiSchema={uiSchema}
examples={method.examples as ExamplePairingObject[]}
method={method}
Expand All @@ -149,9 +150,9 @@ class Methods extends Component<IProps> {
}
{this.props.methodPlugins && this.props.methodPlugins.length > 0 &&
<ExpansionPanelDetails key="method-plugins">
{this.props.methodPlugins.map((CompDef: any) => {
{this.props.methodPlugins.map((CompDef: any, index: number) => {
return (
<CompDef openrpcMethodObject={method} />
<CompDef key={`method-plugin-${index}`} openrpcMethodObject={method} />
);
})}
</ExpansionPanelDetails>
Expand Down

0 comments on commit cf8debc

Please sign in to comment.