jedireza / hapi-react-views

:package: A hapi view engine for React components
MIT License
231 stars 33 forks source link

How to add a script block to the layout ? #38

Closed daslicht closed 8 years ago

daslicht commented 8 years ago

How to add a script block to the layout ?

jedireza commented 8 years ago

Thanks for opening an issue. I don't fully unerstand what you mean, could you elaborate?

daslicht commented 8 years ago

Thank you for your reply!

How would you add jQuery Plugins here: https://github.com/jedireza/hapi-react-views/blob/master/examples/layout/views/layout.jsx#L18 Or just a inline script block

Cheers Marc

jedireza commented 8 years ago

Apologies for the delay. You should be able to simply include them like any other tag. We do this in the remount example here: https://github.com/jedireza/hapi-react-views/blob/d0529ad389c7c51d2c8b5d2d62870a02b8dae9ac/examples/remount/components/html.jsx#L19

When I first started working with React I wanted to include jQuery too. I eventually learned that's not always the best way to go. I recommend checking out:

daslicht commented 8 years ago

If I add the script tag here : https://github.com/jedireza/hapi-react-views/blob/master/examples/layout/views/layout.jsx#L18 I just get an error

jedireza commented 8 years ago

Without knowing the error I'm unable to help more.

daslicht commented 8 years ago

never mind, i put it on ice. Probably I will post something into-depth later when I have more time. Thank you very much !

daslicht commented 8 years ago

solved, i Just tried it again , and there were nor errors anymore , strange but hey GREAT