Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResponsiveOrdinalFrame key warning when using custom annotation #473

Closed
niwsa opened this issue May 17, 2019 · 1 comment
Closed

ResponsiveOrdinalFrame key warning when using custom annotation #473

niwsa opened this issue May 17, 2019 · 1 comment

Comments

@niwsa
Copy link

niwsa commented May 17, 2019


Check the render method of `AnnotationLayer`. See https://fb.me/react-warning-keys for more information.
    in g (at Donut.semiotic.jsx:44)
    in AnnotationLayer (created by Frame)
    in div (created by _default)
    in _default (created by Frame)
    in div (created by _default)
    in _default (created by Frame)
    in Frame (created by OrdinalFrame)
    in OrdinalFrame (created by ResponsiveOrdinalFrame)
    in div (created by ResponsiveOrdinalFrame)

I am using svgAnnotationRules as shown below

svgAnnotationRules={d => {
          console.log(d);
          // Catch annotation with type="r"
          if (d.d.type === "custom") {
            return (
              <g
                fontSize="12"
                textAnchor="middle"
                fontWeight="bold"
                fill={"pink"}
                transform={`translate(${d.adjustedSize[0] / 2}
                 ${d.adjustedSize[0] / 2})`}
              >
                <text>{d.d.note.title}</text>
              </g>
            );
          }

          return null;
}}
@emeeks
Copy link
Member

emeeks commented Sep 3, 2019

Sorry I didn't respond to this earlier. You can send the a key property to your <g> and that will stop it from complaining. Custom annotations aren't wrapped in anything so there's no way for me to give them unique keys or know what might be in conflict with other keys. Also if I ignore your issue in the future feel free to ping me, I just didn't see it, this should not have taken three months to respond.

@emeeks emeeks closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants