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?

LEJ
  • 1,868
  • 4
  • 16
  • 24
  • This answer should help you https://stackoverflow.com/questions/41216654/react-adding-component-after-ajax-to-view/41216726#41216726 – Shubham Khatri Jul 17 '17 at 08:47
  • First of all as you are saying you are using it like ``, this won't work, you should try renaming it with all caps ie ``. Please share the code so that we can help you. This is just an assumption. – Surya Purohit Jul 17 '17 at 08:48
  • You guys should have posted that as an answer... worked a charm! Thanks – LEJ Jul 17 '17 at 08:52

2 Answers2

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.

Surya Purohit
  • 1,090
  • 1
  • 9
  • 29
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

LEJ
  • 1,868
  • 4
  • 16
  • 24