[英]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.