Adding script tag to React/JSX

后端 未结 17 1111
感动是毒
感动是毒 2020-11-22 03:52

I have a relatively straightforward issue of trying to add inline scripting to a React component. What I have so far:

\'use strict\';

import \'../../styles/         


        
17条回答
  •  萌比男神i
    2020-11-22 04:24

    I created a React component for this specific case: https://github.com/coreyleelarson/react-typekit

    Just need to pass in your Typekit Kit ID as a prop and you're good to go.

    import React from 'react';
    import Typekit from 'react-typekit';
    
    const HtmlLayout = () => (
      
        
          

    My Example React Component

    ); export default HtmlLayout;

提交回复
热议问题