react next.js中引用iconfont中的svgsymbol模式方法

import React, { Component,memo } from 'react'
class icon extends Component {
  componentDidMount() {
  if(typeof window !== 'undefined'){
    require('../public/js/iconfont.js');
  }
}
  render() {
    //console.log("props",this.props);
    const {className,addclass}=this.props
    return(
      <>
      
      
  )
  }
}
export default memo(icon)

//用法:
import Icon from '../components/icon';

 

你可能感兴趣的:(next.js,react-next)