2017-04-11 133 views
0

ReactJS的一個教程中,我碰巧看到下面的代碼。ReactJS中的import createStore和import {createStore}之間的區別

import React from 'react'; 
import {createStore} from 'redux'; 

問題1:那麼什麼是點{},我敢肯定,一定有東西非常有趣和有意義的。

問題2:我來自Python的背景,所以想看看在ES6進口多麼相似/不同的是Python的方式不同(我們沒有{}在Python類型

+0

還請檢查此問題:http://stackoverflow.com/questions/36795819/when-should-i-use-curly-braces-for-es6-import –

+0

謝謝@MayankShukla讓我在您分享的鏈接中探索我的問題2的答案。 – rrmerugu

+0

你也可以找到這個有用的:http://stackoverflow.com/questions/41337709/in-reactjs-when-should-i-add-brackets-when-import/41338672#41338672 –

回答

-1

在這情況下,{}destructuring assignment,它需要做的是如何Redux的出口createStore功能。

比較它到Python這將是 from redux import createStore VS import react

相關問題