Please change to: import Panel from 'react-bootstrap/lib/Panel'. When importing from react-bootstrap you need to import the component from ...
Home
Public
Questions
Tags
Users
Collectives
ExploreCollectives
FindaJob
Jobs
Companies
Teams
StackOverflowforTeams
–Collaborateandshareknowledgewithaprivategroup.
CreateafreeTeam
WhatisTeams?
Teams
CreatefreeTeam
CollectivesonStackOverflow
Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost.
Learnmore
Teams
Q&Aforwork
Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch.
Learnmore
react-bootstrapandPanel.Body
AskQuestion
Asked
4years,1monthago
Modified
2years,10monthsago
Viewed
9ktimes
6
1
I'mnewtoReact,somaybeI'mmissingsomethinghere,butIwanttousethePanelcomponentfromreact-bootstrap.I'mfollowingthedocumentation,butgettingthefollowingbehavior.
Thiscodeworks:
import{Panel}from'react-bootstrap';
(...)
return(#Thisisinsidemycomponent'srender()
Foo
)
Thiscodedoesn'twork:
import{Panel}from'react-bootstrap';
(...)
return(#Thisisinsidemycomponent'srender()
Foo
)
Theerrorsays:UncaughtError:Elementtypeisinvalid:expectedastring(forbuilt-incomponents)oraclass/function(forcompositecomponents)butgot:undefined.Youlikelyforgottoexportyourcomponentfromthefileit'sdefinedin.Checktherendermethodof(ComponentName).
WhatamIdoingwrong?Manythanks!
react15.6.2,
react-bootstrap0.31.5
reactjsreact-bootstrap
Share
Follow
askedJan18,2018at11:04
petrpetr
9791010silverbadges2323bronzebadges
1
2
Panel#removed,replacedwithCardcomponentsreact-bootstrap.netlify.com/migrating/#panel
– BassamHajar
Apr24,2019at6:08
Addacomment
|
2Answers
2
Active
Oldest
Votes
11
Pleasechangeto:
importPanelfrom'react-bootstrap/lib/Panel'
Whenimportingfromreact-bootstrapyouneedtoimportthecomponentfromthelibfolder.
Share
Follow
answeredJan18,2018at11:11
NirBen-YairNirBen-Yair
1,45622goldbadges1212silverbadges1616bronzebadges
3
@petritneedstowork.takealookat:codesandbox.io/s/1y347ozjl7
– NirBen-Yair
Jan18,2018at12:38
2
Thankyouverymuchforclarification.Itwasintheparticularversionofreact-bootstrap,wewereusing0.31.5andyouused0.32,sothatdirectedmetothecauseoftheproblem.Apparentlyreact-bootstrap'sAPIwaschangedbetweentheversions.Thankyou!
– petr
Jan18,2018at13:24
Anywaytodebugthis?I’musingv0.32.4andstillrunningintothisissue.Ican’treallyfigureoutwhyit’shappening.I’vetriedimportingthecomponentasmentionedintheanswer.Wonderingifmaybethere’ssomeinteropissuewithanotherlibraryI’musing.AnyhelpwouldbeappreciatedasIcan’treallyfindalotofresourcesonitandI’mnotquitereadytoopenanissueonthegithubproject.Thanks!
– dst3p
Dec21,2018at23:44
Addacomment
|
1
Iwasgettingthesameproblemupdatedmyreact-bootstrapversionfrom'0.30.7'to'0.32.4'.
Share
Follow
answeredDec25,2018at11:57
RajanChauhanRajanChauhan
44111goldbadge77silverbadges1616bronzebadges
Addacomment
|
YourAnswer
ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers.
Draftsaved
Draftdiscarded
Signuporlogin
SignupusingGoogle
SignupusingFacebook
SignupusingEmailandPassword
Submit
Postasaguest
Name
Email
Required,butnevershown
PostYourAnswer
Discard
Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy
Nottheansweryou'relookingfor?Browseotherquestionstaggedreactjsreact-bootstraporaskyourownquestion.
TheOverflowBlog
Howshardingadatabasecanmakeitfaster
FeaturedonMeta
StackExchangeQ&AaccesswillnotberestrictedinRussia
PlannedmaintenancescheduledforFriday,March18th,00:30-2:00UTC...
AnnouncinganA/BtestforaTrendingsortoption
Improvingthefirst-timeaskerexperience-Whatwasaskingyourfirst...
Related
1694
LoopinsideReactJSX
695
WhatisthedifferencebetweenstateandpropsinReact?
893
UnderstandinguniquekeysforarraychildreninReact.js
1980
ProgrammaticallynavigateusingReactrouter
843
HowdoIconditionallyaddattributestoReactcomponents?
472
InvariantViolation:ObjectsarenotvalidasaReactchild
3
Formikwithreact-bootstrapstyling
1
Componentisundefinedwhenusereact-bootstrap
1
Renderingreact-bootstrapcomponentcausingerrors
HotNetworkQuestions
HowlongdoesGnarledSage's+0/+2stickaroundfor?
HowdidIndiaandPakistanavoidwarwhenIndiaaccidentallylaunchedamissileatPakistan?
executingstaticmethodfromanotherclassandaddingparameters
Do0.2vs0.5mlepitubesrequiredifferentPCRmachines,incubators,etc?
CouldGödel’sincompletenesstheorembecircumventedwithaquine?
Removingandre-usingaShimanoTourneyderaileurhanger-vintageroadbike
Woulda(nuclear)strikethathitsanNATOmemberstateembassy/extraterritorialityinUkrainebeconsidereda(nuclear)strikeagainstNATO?
Whatistheapparentcontradictioninthisintegral?
CanIuse"beexposedto"forpositivethings?
NegativeofanASCIIphoto
Opening/Closingprayerintheagendaatanacademicconference-why?
Multiplecomparisonsw/o"als"
Whydoplayersleavesolittletimeforthelastmoves?
GeometricdefinitionofdivergenceusingcurvaturementionedinTristanNeedham
WhatisthedistinctionbetweenMonstrositiesandBeasts?
Canyouhavetwofirstlanguages?
LTSpice:Whyaremycapacitorshalfchargedatsimulationstart?
Whatcanreplaceflashplayer
whatisswitchdevicemacaddress?
WhereintheSFDXtreedotranslationsofquickactionsgo?
Whycan'tIreturnstd::getline'sas-if-booleanresult?
Willpeoplekeepdrinkingalcoholicdrinkseveniftheydon'tgetintoxicatedanymore?
Canaverybrightlightattractanincominglaserguidedweapon?
PatchingOTproductsinamanufacturingassemblyline?
morehotquestions
Questionfeed
SubscribetoRSS
Questionfeed
TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader.
lang-js
Yourprivacy
Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy.
Acceptallcookies
Customizesettings