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

SVG画像をコンポーネント内で使えるようにする #104

Closed
mii288 opened this issue Feb 12, 2021 · 1 comment · Fixed by #103 or #90
Closed

SVG画像をコンポーネント内で使えるようにする #104

mii288 opened this issue Feb 12, 2021 · 1 comment · Fixed by #103 or #90
Assignees

Comments

@mii288
Copy link
Member

mii288 commented Feb 12, 2021

No description provided.

@mii288 mii288 added this to the Migrate from Hugo to Next.js milestone Feb 12, 2021
@mii288 mii288 self-assigned this Feb 12, 2021
@mii288 mii288 changed the title SVGをコンポーネント内で使えるようにする SVG画像をコンポーネント内で使えるようにする Feb 12, 2021
@mii288 mii288 removed a link to a pull request Feb 12, 2021
@mii288 mii288 closed this as completed Feb 13, 2021
@mii288
Copy link
Member Author

mii288 commented Feb 13, 2021

SVGを読み込むサンプルコード

// NOTE: airbnb/babel-plugin-inline-react-svgがaliasに非対応のため相対パスで読み込んでいます
// https://github.com/airbnb/babel-plugin-inline-react-svg/pull/17
import LogoSVG from './logo.svg'
export const Logo: typeof LogoSVG = (props) => <LogoSVG {...props} />
export default Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment