Guest User

Untitled

a guest
Feb 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var Tagname = 'Species';
  2. options.push(<Tagname {...attrs}/>);
  3.  
  4. Warning: <Species /> is using uppercase HTML. Always use lowercase HTML tags in React.
  5. Warning: The tag <Species> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.
  6.  
  7. var Tagname = Species; //component itself, not string
  8. <Tagname {...attrs}/>;
  9.  
  10. const Map = {
  11. "componenet1": Component1,
  12. "componenet2": Component2
  13. }
  14.  
  15. let name = "componenet1";
  16. let Tagname = Map[name];
  17. <Tagname {...attrs}/>;
Add Comment
Please, Sign In to add comment