react-ux-password-field icon indicating copy to clipboard operation
react-ux-password-field copied to clipboard

Node should use compiled version

Open sedenardi opened this issue 10 years ago • 4 comments

When I load this to be rendered server-side in node I get:

node_modules/react-ux-password-field/src/index.js:229
      infoBar = <div className="passwordField__info" style={this.infoStyle}>
                ^
SyntaxError: Unexpected token <

This is because I have babel setup to only transpile .jsx files. The issue is solved if I change package.json to point to the compiled ./lib/react-ux-password-field.js instead.

sedenardi avatar Nov 30 '15 22:11 sedenardi

Actually seems there are quite a lot of issues preventing this from being rendered server-side, including the use of componentWillMount() instead of componentDidMount() and references to navigator in render().

sedenardi avatar Nov 30 '15 22:11 sedenardi

Yeah, that makes perfect sense. This component was mostly an experiment, and didn't take server-side rendering into account.

If you'd like to submit a PR, I'd be happy to merge it in.

Thanks.

seethroughdev avatar Dec 03 '15 18:12 seethroughdev

:+1: for this one. Any updates available?

tsironis avatar Feb 09 '16 13:02 tsironis

@tsironis can you confirm what your issue is here? is it "main" pointing to the src file?

seethroughdev avatar Feb 10 '16 07:02 seethroughdev