File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
83 <PageLayout
84 title="Customers"
85 extra={[
86 <Button type="primary" size="large" onClick={openCustomerModal}> 87 Create Customer 88 </Button>, 89 ]}
90 >
91 <div>
584 borderStyle: "solid",
585 }}
586 extra={[
587 <Button htmlType="button" onClick={showFeatureModal}>588 Add Feature589 </Button>,590 ]}
591 >
592 <Form.Item
565 >
566 <Radio.Group disabled={type === "version" ? true : false}>
567 {availableBillingTypes.map((type) => (
568 <Radio value={type.name}>{type.label}</Radio>569 ))}
570 </Radio.Group>
571 </Form.Item>
527 }}
528 className="h-full"
529 extra={[
530 <Button531 htmlType="button"532 onClick={() => showComponentModal()}533 >534 Add Component535 </Button>,536 ]}
537 >
538 <Form.Item
436 >
437 <Radio.Group>
438 {availableBillingTypes.map((type) => (
439 <Radio value={type.name}>{type.label}</Radio>440 ))}
441 </Radio.Group>
442 </Form.Item>
A key
is a special string attribute you need to include when creating lists of elements because keys help React
identify which items have changed, added, or removed.
Keys should be given to the elements to give them a stable identity.
The best way to pick a key
is to use a string that uniquely identifies a list item among its siblings. Most often, you would use IDs from your data as keys.
When you don't have stable IDs for rendered items, you may use the item index as a key
as a last resort.
// Missing key for component
[<Hello />, <Hello />, <Hello />];
// Missing key for each element data
data.map(x => <Hello>{x}</Hello>);
// Invalid Syntax: `key` attribute before spread
<span key={"key-after-spread"} {...spread} />;
// Missing `key` attribute
data.map(x => <>{x}</>);
// Updated component with key
[<Hello key="first" />, <Hello key="second" />, <Hello key="third" />];
// Updated component with key for array `data`
data.map((x, i) => <Hello key={i}>{x}</Hello>);
// `key` attribute after spread
<span {...spread} key={"key-after-spread"} />;
// Updated `key` attribute
data.map(x => <key="key">{x}</>);