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

Can I keep pug template in separate file? #19

Closed
mars-abd opened this issue Nov 1, 2017 · 7 comments
Closed

Can I keep pug template in separate file? #19

mars-abd opened this issue Nov 1, 2017 · 7 comments

Comments

@mars-abd
Copy link

mars-abd commented Nov 1, 2017

Like this:

MyComponent/
    MyComponent.pug
    MyComponent.styl
    MyComponent.js

MyComponent.pug:

div(class=`${styles.container}`)
    p
        = this.state.text

MyComponent.js:

import React from 'react';
import styles from './MyComponent.styl';
import template from './MyComponent.pug'; // raw text loader

class MyComponent extends React.Component {
  render() {
    return pug`${template}`;
  }
}
@ezhlobo
Copy link
Member

ezhlobo commented Nov 10, 2017

@mars-abd you can't (at least now).

It's also not planned for near future: #15

@mars-abd
Copy link
Author

Sorry, it is duplicated issue

@SilencerWeb
Copy link

@mars-abd you can use this plugin https://github.com/bluewings/pug-as-jsx-loader/blob/master/README.md#import-pug-template

@ezhlobo
Copy link
Member

ezhlobo commented Mar 20, 2018

Let's close this issue, since it's a duplicate. We can continue working on it, or just discuss it, within #15.

//CC @ForbesLindesay

@ForbesLindesay
Copy link
Member

@ezhlobo you should have permission to close issues yourself if you want to. I agree that we should close this issue as a duplicate though :)

@ezhlobo
Copy link
Member

ezhlobo commented Mar 21, 2018

@ForbesLindesay I actually don't have any permission here

@ForbesLindesay
Copy link
Member

Ooops, it looks like I created a react-pug team, and added you to it, but forgot to add the repository. Should be fixed now :)

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

4 participants