https://linen.dev logo
Join DiscordCommunities
Powered by
# react
  • u

    user

    06/28/2019, 4:57 PM
    I understand people can start hating classes because of all that :)
  • u

    user

    06/28/2019, 4:59 PM
    And people freak out when the original lifecycle methods are touched - good riddance to
    componentWillReceiveProps
    but reactions have been heated
  • u

    user

    06/28/2019, 5:01 PM
    well, ok, if you use a dynamically typed language and APIs start moving under your feet you have every reason to freak out :D
  • u

    user

    06/28/2019, 5:02 PM
    And npm modules rot
  • u

    user

    06/28/2019, 5:06 PM
    As of now we have 95 occurences of
    componentWillReceiveProps
    in our codebase. And a lot of these functions are here to track props "transitions" as they compare previous and new props to decide whether state needs to be recalculated. This isn't going to be fun to refactor.
  • u

    user

    06/28/2019, 5:07 PM
    isn't that what getDerivedStateFromProps is for? ^^
  • u

    user

    06/28/2019, 5:07 PM
    This function doesn't give you the previous props, only new props and current state
  • u

    user

    06/28/2019, 5:08 PM
    And of course, because the codebase is a mess, we have a lot of sideeffects happening in
    componentWillReceiveProps
  • u

    user

    06/28/2019, 5:13 PM
    \o/
  • u

    user

    06/28/2019, 5:37 PM
    The side effects will be fun x)
  • a

    ambitious-knife-25690

    07/10/2019, 4:36 PM
    Is there a base project for using react-native + modular?
  • a

    ambitious-knife-25690

    07/10/2019, 4:39 PM
    Oh, am I correct in that I don't have to bother with the libs.js folder with react-native?
  • u

    user

    07/10/2019, 4:59 PM
    @ambitious-knife-25690 react-native requires to build like a node application, e.g. without the
    libs.js
    and the
    require
    stub. This will happen if there is
    -D nodejs
    .
  • u

    user

    07/10/2019, 5:02 PM
    I didn't try whether that works though.
  • a

    ambitious-knife-25690

    07/10/2019, 6:05 PM
    I will try to mess around with it and see if I can something working
  • a

    ambitious-knife-25690

    07/10/2019, 6:16 PM
    So haxe-modular can't find
    haxe-split
    - I like to install npm modules in a /bin/node-modules could it be because I haven't ran installed npm haxe-modular in the project's root?
  • u

    user

    07/10/2019, 6:52 PM
    Yes it's expecting to find node_modules in the working directory
  • u

    user

    07/10/2019, 6:53 PM
    Alternative is to have
    haxe-split
    in the PATH I think
  • a

    ambitious-knife-25690

    07/10/2019, 7:31 PM
    Anyway to change that configuration?
  • a

    ambitious-knife-25690

    07/10/2019, 7:32 PM
    node modules, especially with a react native project makes for a very messy root dir ha
  • u

    user

    07/10/2019, 8:22 PM
    @ambitious-knife-25690 as I said, you can set the PATH to include
    ./bin/node_modules/.bin/
    before running the Haxe compiler, or use the undocumented
    -D haxe_split=/path/to/haxe-spit
  • u

    user

    07/10/2019, 8:24 PM
    https://github.com/elsassph/haxe-modular/blob/master/src/Split.hx#L51
  • a

    ambitious-knife-25690

    07/29/2019, 6:17 AM
    Copy code
    haxe
    const drawerWidth = 240;
    
    const useStyles = makeStyles(theme => ({
      root: {
        display: 'flex',
      },
      appBar: {
        width: `calc(100% - ${drawerWidth}px)`,
        marginLeft: drawerWidth,
      },`
      drawer: {
        width: drawerWidth,
        flexShrink: 0,
      },
    What is the conversion process of react code like? Particularly the style itself + the
    appBar.width
    code
  • a

    ambitious-knife-25690

    07/29/2019, 6:17 AM
    I'm using k-labz material-ui
  • u

    user

    07/30/2019, 1:57 PM
    Hi, here's the small doc I gave to coworkers internally: https://gist.github.com/kLabz/20f6e4dece9aa4c256af58514626b66f Some needed classes are in mui.core.styles package MuiTheme currently has to be constructed on your end And I need to add special cases..
  • u

    user

    07/30/2019, 2:00 PM
    Added a comment there with another example
  • a

    ambitious-knife-25690

    07/31/2019, 3:22 PM
    Thanks!
  • a

    ambitious-knife-25690

    07/31/2019, 3:23 PM
    It looks like creating externs for react/react-native is more complicated with react-next
  • a

    ambitious-knife-25690

    07/31/2019, 3:23 PM
    not sure how to proceed with externs now, there's so many
    prop
    classes etc
  • a

    ambitious-knife-25690

    07/31/2019, 3:23 PM
    not saying it's bad, just overwhelming
1...121314...80Latest