0

I have a component in a .js file which I have exported as default. I am trying to include this component in another .js file. I have also imported this component in the other file. I have tried using <componentName /> but this does not seem to work, it compiles and shows no error but nothing shows up. Any ideas?

3
  • This answer should help you stackoverflow.com/questions/41216654/… Commented Jul 17, 2017 at 8:47
  • First of all as you are saying you are using it like <componentName />, this won't work, you should try renaming it with all caps ie <ComponentName />. Please share the code so that we can help you. This is just an assumption. Commented Jul 17, 2017 at 8:48
  • You guys should have posted that as an answer... worked a charm! Thanks Commented Jul 17, 2017 at 8:52

2 Answers 2

1

First of all, as you are saying you are using it like <componentName />, this won't work, you should try renaming it with all caps ie. <ComponentName />. This is just an assumption. If the issue persists, please share the code, so that we can help you in a better way. Discussion can be found here.

Sign up to request clarification or add additional context in comments.

Comments

0

As mentioned in the comments, the component name that I was attempting to add is required to start with a capital letter as components beginning with lowercase letters are searched as default DOM elements

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.