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

    ambitious-knife-25690

    08/28/2020, 2:14 PM
    Omg
  • a

    ambitious-knife-25690

    08/28/2020, 2:14 PM
    Nvm had a brainfart moment lol
  • u

    user

    08/28/2020, 2:14 PM
    Missing a
    .root
    somewhere?
  • a

    ambitious-knife-25690

    08/28/2020, 2:16 PM
    yeah
  • a

    ambitious-knife-25690

    08/28/2020, 2:16 PM
    forgot to do that part 😅
  • u

    user

    08/28/2020, 2:17 PM
    Yeah that can lead to strange errors x)
  • u

    user

    10/30/2020, 3:00 PM
    hi
  • u

    user

    10/30/2020, 3:01 PM
    say i have a basic component, lets call it widget, which just represents a container but i want to make this container resizable, or draggable or draggable and resizable what would be the best way to add this functionality to the component?
  • u

    user

    10/30/2020, 3:01 PM
    so i have my base class widget, and i use composition to create a "Window" component which returns a widget but i want the returned widget to have resizable functionality in that case i can use a higher-order component, but what if i want to also add the draggable functionality to the "Window" as well?
  • u

    user

    10/30/2020, 3:01 PM
    Copy code
    js
    // Basic widget component
    class Widget extends Component {
      render() {
        return <div className={`widget ${ this.props.className }`}>{this.props.children}</div>;
      }
    
      // Widget functionality
      // ...
    };
    
    // This widget component will include the resizable functionality
    class Resizable extends Component {
      render() {
        return <Widget className="resizable">I am a widget that has resizable functionality</Widget>
      }
    
      //Resiazable functionality
      // ...
    }
    
    // This widget component will include the draggable functionality
    class Draggable extends Component {
      render() {
        return <Widget className="draggable">I am a widget that has draggable functionality</Widget>
      }
    
      // Draggable functionality
      // ...
    }
    
    // This widget component needs to reuse the resizable and draggable functionality of "Resizable" AND "Draggable"
    class Window extends Component {
      render() {
        return <Widget className="window">I am a widget that needs draggable and resizable functionality</Widget>
      }
    
      // Window functionality
      //
    }
    
    // This widget component needs to reuse the resizable and draggable functionality of "Resizable" AND "Draggable" and window functionality of "Window"
    class App extends Component {
      render() {
        return <Widget className="app">I am a widget just like window, but with extra functionality for App</Widget>
      }
    
      // App functionality
      // ...
    };
  • u

    user

    10/30/2020, 3:02 PM
    this kind of pattern, window needs functionality from both the draggable and resizable components
  • u

    user

    10/30/2020, 3:03 PM
    actually app would just return a Window component, so ignore that
  • u

    user

    10/30/2020, 3:04 PM
    can higher-order components be used to pass in functionality of multiple other components?
  • a

    ambitious-knife-25690

    11/08/2020, 9:39 PM
    might have forgotten but what is the way to replicate this functionality in haxe mui? @User
  • u

    user

    11/09/2020, 5:39 AM
    Uhh I think it's possible, but don't remember how either
  • u

    user

    11/09/2020, 5:40 AM
    I'll check in my work project if I used it
  • u

    user

    11/09/2020, 6:40 AM
    Seems like you can use
    mui.core.styles.Styles.mergeJss({ ... },  theme.mixins.toolbar)
  • u

    user

    11/09/2020, 6:40 AM
    Or the other way around if you want to override things from toolbar
  • a

    ambitious-knife-25690

    11/09/2020, 5:07 PM
    ooo
  • a

    ambitious-knife-25690

    11/09/2020, 5:07 PM
    my tempory workaround 🤣
  • u

    user

    11/09/2020, 5:12 PM
    Yeahh I suppose that works too xD
  • w

    wide-greece-63479

    11/30/2020, 10:49 AM
    Which is the most up-to-date repo for starting playing with haxe-react? kLabz? massiveinteractive? haxe-react?
  • u

    user

    11/30/2020, 10:58 AM
    The two should be more or less as up to date as the other Mine enforces more typing (original one won't check your props) and uses a different jsx parser (not sure you can use inline xml (without string) in original haxe-react, but maybe that was backported too xD edit: yes it was https://github.com/massiveinteractive/haxe-react/pull/133)
  • u

    user

    11/30/2020, 10:59 AM
    Main differences were explained there https://github.com/kLabz/haxe-react/blob/next/doc/react-next.md
  • w

    wide-greece-63479

    12/02/2020, 1:43 PM
    Thanks, @User!
  • w

    wide-greece-63479

    12/02/2020, 1:44 PM
    I'm into https://github.com/elsassph/haxe-react-redux now... Philippe writes:
  • w

    wide-greece-63479

    12/02/2020, 1:44 PM
    "Using Haxe enums can function but they are not serialisable in Json."
  • w

    wide-greece-63479

    12/02/2020, 1:45 PM
    ... in state.
  • w

    wide-greece-63479

    12/02/2020, 1:45 PM
    Is there any other problem with using enums in state, than the problem of serializing to/from json?
  • w

    wide-greece-63479

    12/02/2020, 1:46 PM
    (tink_json can handle that quite neatly.)
1...545556...80Latest