https://linen.dev logo
Join Discord
Powered by
# react
  • c

    cool-psychiatrist-49311

    01/28/2020, 7:34 AM
    if so, you need to include react by adding a
    <script>
    tag
  • n

    numerous-oil-90946

    01/28/2020, 7:39 AM
    I follow exactly there example so I have this constant defined
  • n

    numerous-oil-90946

    01/28/2020, 7:40 AM
    and
  • n

    numerous-oil-90946

    01/28/2020, 7:40 AM
    Copy code
    html
        <script src="//cdnjs.cloudflare.com/ajax/libs/react/16.3.0/umd/react.development.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/react-dom/16.3.0/umd/react-dom.development.js"></script>
  • n

    numerous-oil-90946

    01/28/2020, 7:40 AM
    But it can't find the file ^^'
  • b

    brainy-machine-50829

    01/28/2020, 7:43 AM
    Where did you put that elements?
  • n

    numerous-oil-90946

    01/28/2020, 7:44 AM
    In the html but now it is working
  • n

    numerous-oil-90946

    01/28/2020, 7:45 AM
    The link that they are given in the exemple are down
  • n

    numerous-oil-90946

    01/28/2020, 7:45 AM
    I used the new one from cloudflare and now it is working
  • b

    brainy-machine-50829

    01/28/2020, 7:45 AM
    That's why I usually avoid cdns. 😄
  • b

    brainy-machine-50829

    01/28/2020, 7:45 AM
    Although they can make things faster, it's still an external dependency.
  • n

    numerous-oil-90946

    01/28/2020, 7:51 AM
    If i use browserify, no need for this external?
  • b

    brainy-machine-50829

    01/28/2020, 7:52 AM
    Yeah, then you should
    require
    it as for normal nodeJS app, and it will bundle it up.
  • n

    numerous-oil-90946

    01/28/2020, 7:58 AM
    Sorry where? ^^'
  • n

    numerous-oil-90946

    01/28/2020, 7:58 AM
    Do you have any exemple on the internet?
  • n

    numerous-oil-90946

    01/28/2020, 8:01 AM
    And little question how can you read file content in js ?
  • n

    numerous-oil-90946

    01/28/2020, 8:01 AM
    ^^'
  • b

    brainy-machine-50829

    01/28/2020, 8:01 AM
    Any node tutorial should do. Basically you install stuff via
    npm install <lib>
    or whatever, and then you
    var lib = require("libName)
    and can use it.
  • b

    brainy-machine-50829

    01/28/2020, 8:02 AM
    In nodeJS there's the
    fs
    module. In web you can't really, at least not without user interaction.
  • n

    numerous-oil-90946

    01/28/2020, 8:02 AM
    for now I am doing an haxe build.hxml and then a browserify
  • n

    numerous-oil-90946

    01/28/2020, 8:02 AM
    That gives me a js file
  • n

    numerous-oil-90946

    01/28/2020, 8:02 AM
    So the require is in haxe?
  • n

    numerous-oil-90946

    01/28/2020, 8:02 AM
    thanks 🙂
  • b

    brainy-machine-50829

    01/28/2020, 8:04 AM
    It's in
    js.Lib
    iirc.
  • n

    numerous-oil-90946

    01/28/2020, 8:04 AM
    Wow there is no way to read a file without any user interact? ^^'
  • b

    brainy-machine-50829

    01/28/2020, 8:04 AM
    In the browser, no, obviously. You wouldn't want random website to browse your folder, would you? 🙂
  • n

    numerous-oil-90946

    01/28/2020, 8:04 AM
    Can't find it ^^'
  • b

    brainy-machine-50829

    01/28/2020, 8:05 AM
    https://api.haxe.org/js/Lib.html#require
  • n

    numerous-oil-90946

    01/28/2020, 8:05 AM
    Thanks 🙂
  • n

    numerous-oil-90946

    01/28/2020, 8:06 AM
    But I want to parse a json file to generate objects ^^'
1...373839...80Latest