S
S
Shakir Darion2020-01-20 12:51:14
React
Shakir Darion, 2020-01-20 12:51:14

SyntaxError: unknown: Default namespace tags are not supported. React JSX does not support namespace tags. can you turn it on?

I am getting the following error when trying to load svg as ReactComponent.
SyntaxError: unknown: Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning.

import React from "react";
import { ReactComponent as LO } from "../a/Logo.svg"
import { NavLink } from "react-router-dom";

const Logo = () => (
  <>
    <NavLink to={"/"}>
     <LO width={"40px"} height={"40px"} />
    </NavLink>
  </>
);

export default Logo;

SyntaxError: unknown: Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
camelCaseVlad, 2020-01-20
@camelCaseVlad

Give the code of the svg.
follow the JSX syntax

stroke="none" strokeWidth="1" fill="none" fillRule="evenodd"
etc.
but not
stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"
etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question