Skip to content

Commit

Permalink
fix: remove uniqueKey from ViewerAnchor API
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite committed Aug 2, 2023
1 parent 0a9e11f commit 1d68777
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ export type ViewerAnchorElementMapping = {
export type ViewerAnchorProps = {
position: Vector3;
children: ReactElement;
uniqueKey: string;
};

export const ViewerAnchor = ({
position,
children,
uniqueKey
children
}: ViewerAnchorProps): ReactElement => {
const viewer = useReveal();
const [divTranslation, setDivTranslation] = useState(new Vector2());
Expand Down Expand Up @@ -50,7 +48,6 @@ export const ViewerAnchor = ({

return visible ? (
<div
key={uniqueKey}
ref={htmlRef}
style={{
position: 'absolute',
Expand Down
4 changes: 2 additions & 2 deletions react-components/stories/ViewerAnchor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Main: Story = {
styling={styling}
fdmAssetMappingConfig={fdmAssetMappingConfig}
/>
<ViewerAnchor position={position} uniqueKey="key2">
<ViewerAnchor position={position} >
<p
style={{
backgroundColor: 'turquoise',
Expand All @@ -62,7 +62,7 @@ export const Main: Story = {
This label is stuck at position {position.toArray().join(',')}
</p>
</ViewerAnchor>
<ViewerAnchor position={position2} uniqueKey="key1">
<ViewerAnchor position={position2}>
<p
style={{
backgroundColor: 'red',
Expand Down

0 comments on commit 1d68777

Please sign in to comment.