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

Expected onClick listener to be a function, instead got a value of string type. #12

Open
linneaherman opened this issue Nov 4, 2020 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@linneaherman
Copy link

linneaherman commented Nov 4, 2020

When trying to use this plugin I get the error mentioned in the title when clicking on the copy-button.

Full error:

index.js:1 Warning: Expected `onClick` listener to be a function, instead got a value of `string` type.
    in div (created by Ast)
    in div (created by Ast)
    in Ast (at PostContent.tsx:27)
    in section (created by Context.Consumer)
    in PostFullContent (at PostContent.tsx:25)
    in PostContent (at post.tsx:324)
    in article (created by Context.Consumer)
    in EmotionCssPropInternal (at post.tsx:274)
    in div (created by Context.Consumer)
    in EmotionCssPropInternal (at post.tsx:271)
    in main (created by Context.Consumer)
    in EmotionCssPropInternal (at post.tsx:265)
    in div (created by Context.Consumer)
    in StyledWrapper (at Wrapper.tsx:9)
    in Wrapper (created by Context.Consumer)
    in EmotionCssPropInternal (at post.tsx:257)
    in div (at layouts/index.tsx:17)
    in IndexLayout (at post.tsx:199)
    in PageTemplate (created by HotExportedPageTemplate)
    in AppContainer (created by HotExportedPageTemplate)
    in HotExportedPageTemplate (created by PageRenderer)
    in PageRenderer (at query-result-store.js:86)
    in PageQueryStore (at root.js:56)
    in RouteHandler (at root.js:78)
    in div (created by FocusHandlerImpl)
    in FocusHandlerImpl (created by Context.Consumer)
    in FocusHandler (created by RouterImpl)
    in RouterImpl (created by Context.Consumer)
    in Location (created by Context.Consumer)
    in Router (at root.js:73)
    in ScrollHandler (at root.js:69)
    in RouteUpdates (at root.js:68)
    in EnsureResources (at root.js:66)
    in LocationHandler (at root.js:124)
    in LocationProvider (created by Context.Consumer)
    in Location (at root.js:123)
    in Root (at root.js:132)
    in StaticQueryStore (at root.js:138)
    in _default (at app.js:115)

here is my list of plugins in gatsby-config.js:

plugins: [

    'gatsby-plugin-sitemap',
    {
      resolve: 'gatsby-plugin-sharp',
      options: {
        quality: 100,
        stripMetadata: true,
      },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'content',
        path: path.join(__dirname, 'src', 'content'),
      },
    },
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-responsive-iframe',
            options: {
              wrapperStyle: 'margin-bottom: 1rem',
            },
          },
          {
            resolve: "gatsby-remark-code-buttons",
            options: {
              tooltipText: 'Copy to clipboard',
              toasterText: "Copied to clipboard",
              toasterDuration: 5000,
            },
          },
          'gatsby-remark-prismjs',
          'gatsby-remark-copy-linked-files',
          'gatsby-remark-smartypants',
          'gatsby-remark-abbr',
          {
            resolve: 'gatsby-remark-katex',
            options: {
              // Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here
              strict: 'ignore'
            }
          },
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 2000,
              quality: 100,
            },
          },
        ],
      },
    },
    'gatsby-transformer-json',
    'gatsby-plugin-emotion',
    'gatsby-plugin-typescript',
    'gatsby-transformer-sharp',
    'gatsby-plugin-react-helmet',
    'gatsby-transformer-yaml',
    'gatsby-plugin-feed',
    {
      resolve: 'gatsby-plugin-postcss',
      options: {
        postCssPlugins: [require('postcss-color-function'), require('cssnano')()],
      },
    },
    },
  ]
@jonnysmillie
Copy link

jonnysmillie commented May 17, 2022

Interested to see if anyone has a fix for this or knows why it happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants