reactjs - Pass a connected component into React Route causing error -


when pass connected component export default connect(componentname) react route route code below,

<route path={path} component={componentname}/> 

i following errors,

you must pass component function returned connect.  instead received {"match":{"path":"/:code","url":"/sample- code","isexact":true,"params":{"code":"sample-code"}},"location": {"pathname":"/sample-code","search":"","hash":""},"history": {"length":40,"action":"pop","location":{"pathname":"/sample- code","search":"","hash":""}}} 

can pass connected component route component?

connect take arguments functions mapstatetoprops. meant connect()(componentname).

you can pass connected component route component prop, no need use render prop.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -