Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not do away with .ejs templates altogether #25

Open
ORESoftware opened this issue Mar 30, 2016 · 1 comment
Open

Why not do away with .ejs templates altogether #25

ORESoftware opened this issue Mar 30, 2016 · 1 comment

Comments

@ORESoftware
Copy link

I used to think that having templates (like .ejs) was needed or useful with React.
But now I believe you can just do away with it entirely, and use React's compose-ability.

So why no create a parent component that looks something like so:

const React = require('react');

module.exports = React.createClass({

   render: function(){

      return (

          <html lang="en">
          <head>
              <meta charset="UTF-8">
                  <title>Title</title>
          </head>
          <body>

              {this.props.body}

          </body>
          </html>

      )
   } 
});

perhaps React does not allow <html> <body> <head> tags?

@ORESoftware
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant