简体   繁体   English

如何修复“× TypeError: Object(...) is not a function”?

[英]How to fix “× TypeError: Object(…) is not a function”?

I'm making a netflix clone app in nodejs and got stuck on generateMedia function.我在nodejs中制作了一个netflix克隆应用程序并卡在了generateMedia function上。

On TabContentOne.js file, On import { generateMedia } from 'react-media-query' it is dotted and when I run npm install @types/react-media-query it gives me errors.在 TabContentOne.js 文件中,在import { generateMedia } from 'react-media-query'上,它是点状的,当我运行npm install @types/react-media-query时,它会给我错误。 I did npm i react-media-query .我做了npm i react-media-query

import React from 'react';
import styled from 'styled-components';
import { Button } from './Button';
import { generateMedia } from 'react-media-query'

// Media Query 
const customMedia = generateMedia({
    smDesktop: '1440px',
    tablet: '960px'
})

This is the link from my bitbucket https://bitbucket.org/danclaudiu95/nodejs-reactjs.git I'm expecting to use generateMedia function the put style on some elements in my application but the npm server doesn't start anymore. This is the link from my bitbucket https://bitbucket.org/danclaudiu95/nodejs-reactjs.git I'm expecting to use generateMedia function the put style on some elements in my application but the npm server doesn't start anymore.

I recommend using another package that does the same thing, "react-media-query" is outdated and removed from github.我建议使用另一个 package 做同样的事情,“react-media-query”已过时并从 github 中删除。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复TypeError:registerUser不是函数 - How to fix TypeError: registerUser is not a function 如何解决? (TypeError:预期对象:docusign api) - How to fix it? (TypeError: Object expected : docusign api) 如何修复'TypeError:(images || [])。forEach不是一个函数' - How to fix 'TypeError: (images || []).forEach is not a function' 如何修复“TypeError:Buffer.from 不是函数”? - How to fix 'TypeError: Buffer.from is not a function'? 如何解决“ TypeError:Router.use()需要中间件功能但有一个对象” - How to fix “TypeError: Router.use() requires a middleware function but got a Object” node.js,需要帮助修复此错误“ TypeError:对象不是函数” - node.js, need help to fix this bug “TypeError: object is not a function” 如何解决此“未处理的拒绝类型错误:res.xls 不是函数” - How to fix this “Unhandled rejection TypeError: res.xls is not a function” 如何修复:TypeError:enrollUser is not a function at HTMLButtonElement.onclick - How to Fix : TypeError: enrollUser is not a function at HTMLButtonElement.onclick Gulpfile.js:如何修复“ TypeError:“ listener”参数必须是一个函数”? - Gulpfile.js : How to fix “TypeError: ”listener“ argument must be a function”? 如何修复“ TypeError:Crud.Select_products不是函数”,NodeJS中的错误 - How to fix "TypeError: Crud.Select_products is not a function”, error in NodeJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM