React-Table的导入问题 [英] Import Issue for React-Table
本文介绍了React-Table的导入问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用react-table库在react中创建一个表.几天前,我使用相同的库创建了一个表,并且没有遇到任何问题.但是今天我遇到了以下错误.
I am creating a table in react using react-table library. Few days back, I had created a table using the same library and faced no issues. But today I am getting the following error.
尝试的导入错误:"react-table"不包含默认导出(导入为"ReactTable").
进口声明: 从"react-table"导入ReactTable;
我从头开始创建了多个新项目并安装了节点模块.
I created multiple new projects from scratch and installed the node modules.
有什么办法可以解决这个问题?
Is there any way to resolve this issue?
推荐答案
解决了问题!!!
您必须安装
npm install react-table-6
npm install react-table-6
然后导入
import React, {Component} from 'react';
import ReactTable from 'react-table-6';
import 'react-table-6/react-table.css';
已解决:) 参考 https://www.npmjs.com/package/react-table-6
这篇关于React-Table的导入问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文