I am trying to dynamically render components based on their type.

For example:

```
var type = "Example";
var ComponentName = type + "Component";
return <ComponentName />; 
// Returns <examplecomponent />  instead of <ExampleComponent />

```

I tried the solution proposed here [React/JSX dynamic component names](https://stackoverflow.com/questions/28842459/react-jsx-dynamic-component-names)

That gave me an error when compiling (using browserify for gulp). It expected XML where I was using an array syntax.

I could solve this by creating a method for every component:

```
newExampleComponent() {
    return <ExampleComponent />;
}

newComponent(type) {
    return this["new" + type + "Component"]();
}

```

But that would mean a new method for every component I create. There must be a more elegant solution to this problem.

I am very open to suggestions.