Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Destiny
    @Queendestinywinter28_gitlab
    hey
    TrofinSorin
    @TrofinSorin
    https://www.youtube.com/watch?v=OzaLC-5YLQk&t=329s a nice useEffect and useState tutorial
    tj4000
    @jt4000

    Hello guys, I need some help 'bout how to make a grouping of all API call

    Goal:
    Create a api.js for grouping all api call into a single file.

    Problem:
    If you have many webpages with many api calls, how should you create a group of all api call into a single file?
    Do you have a sample?

    Stackblitz:
    https://stackblitz.com/edit/react-pvb5w2

    Info:
    Angular has a grouping of all call by using service but I don't know if it possibly to create the same approach for react js. Do you have a sample? I'm newbie in reactjs.

    devbinod
    @devbinod
    Hello All, I today I just setup a react-redux application using typescript, redux-thunk technology. In this project, I have used a container pattern. I am requesting to all, Could you review my code, Suggestions really appreciated and help my carrier. Here is a project github link https://github.com/devbinod/react-redux-typescript.
    Cheikhany ould Ejiwen
    @Ejiwen
    i delete the file (registerServiceWorker.js) from my react project ... how can i generate new one ?
    Daniel Olshansky
    @Olshansk

    (super new to react here)

    I have this snippet of code inside the scene I'm returning from render.

      this.state.cylinderPositions.forEach((cylinderPosition, index) => {
              <Entity
                primitive="a-cylinder"
                height={2}
                radius={2}
                position={cylinderPosition}
                color="#FAFAF1"
              />
            })

    I keep getting errors in console that cylinderPosition is not defined. However, if I don't wrap it in {}, I get a JSX value should be either an expression or a quoted JSX text error.

    Any suggestions?

    Florian Rappl
    @FlorianRappl
    Why you have forEach? I guess you want map. Rest also makes not much sense without more context. (also index is unused and I miss a proper key)
    Daniel Olshansky
    @Olshansk
    This was what worked for me:
            {this.state.cylinderPositions.map((cylinderPosition, idx) =>
              <Entity
                primitive="a-cylinder"
                height={2}
                radius={2}
                position={cylinderPosition}
                color="#FAFAF1"
              />
            )}
    1. Use map instead of forEach. This part I understand...
    2. I have to wrap everything in {}. If I don't, cylinderPosition remains undefined. Still not sure why this is?
    Florian Rappl
    @FlorianRappl
    If you wrap as above nothing will be rendered as e.g [1,2,3].map(n => {n*n}) will also give you [undefined, undefined, undefined]
    So if you wrap return the expression, e.g., [1,2,3].map(n => { return n*n })
    Daniel Olshansky
    @Olshansk

    Got it. With that said, why does this render:

            {this.state.cylinderPositions.map((cylinderPosition, idx) =>
              <Entity
                primitive="a-cylinder"
                height={2}
                radius={2}
                position={cylinderPosition}
                color="#FAFAF1"
              />
            )}

    And this throw a cylinderPosition is not defined error:

            this.state.cylinderPositions.map((cylinderPosition, idx) =>
              return <Entity
                primitive="a-cylinder"
                height={2}
                radius={2}
                position={cylinderPosition}
                color="#FAFAF1"
              />
            )
    Daniel Olshansky
    @Olshansk
    I believe this answers my question actually: https://stackoverflow.com/a/42575389/768439
    Alessandro Pio Ardizio
    @pioardi
    https://github.com/pioardi/poolifier@pioardi
    Hi guys
    i implemented two thread pools on top of worker threads
    https://github.com/pioardi/poolifier
    someone would like to contribute on this ?
    Florian Rappl
    @FlorianRappl

    Hi guys, our microfrontend framework based on React soon will reach v1!

    We would love to hear your feedback. Any contributions would be awesome!
    https://github.com/smapiot/piral/

    Thanks :heart: !

    Mayurs
    @Marvin9
    Hey folks! Check out Bitwise Calculator, which is built in React :) If you have time, please review and feedback code.
    Destiny
    @Queendestinywinter28_gitlab
    hey
    RickHeffren
    @Iseeumhmm
    Hi all! Hoping for some help... Im reusing a component in on a page and passing in different props parameters. The issue is that the first of the two components data is persisting and I'm getting exact same component rendered twice even though it has different parameters?
    miganga
    @miganga
    @Iseeumhmm Can you show some code please?
    joystick
    @joystick
    Hello, is this room active?
    Florian Rappl
    @FlorianRappl
    Sure
    Oleksandr
    @quasiunafantasia
    Hi guys.
    Does anyone have any ideas if useMemo hook can be used to evaluate values lazily or on demand?
    For example, i have an asynchronous operation and i want to memoize the result. Using useMemo as is will perform the operation on first render. But i would like some control to trigger the operation manually (eg on user click), not on render.
    Or should i just use plain memoization in this case, not the react hook?
    Anand
    @andy02g_gitlab
    Hi Can any body helpout... is it possible to export image/pdf from highchart in IOS PWA app ?
    Luca Matteis
    @lmatteis
    hey guys. just writing a component. what should i use to do simple HTTP requests? i'd like to use something Suspense maybe? lightweight also
    JesperE
    @Jesbjerg
    Hey, I am new to reactjs - atm I am pondering how data is passed throughout different pages*. I see how it would make sense with props if you have "child/parent" component relation. But what if you have 'Page - using components' and 'Page2 - not using same components as Page'. Am I thinking about this the wrong way, is 'Page' and 'Page2' in a child/parent relationship?
    Mayurs
    @Marvin9
    @lmatteis You can use fetch API. https://reactjs.org/docs/faq-ajax.html. It doesn't require any dependency.
    Mayurs
    @Marvin9
    Hello guys. Anyone interested to work in open source project from scratch. It is not any billion dollar idea. However it is somehow useful. The motive is to experiencing collaborative development & push our skills to real world. Are you in? The skills required is ReactJS or ElectronJS, Other technology we can learn later on during process.
    Saeed Jassani
    @saeedjassani
    Hello guys, I am using react js first time with material-ui. In Typography component there is a "noWrap" option which ellipsises text after the first line
    how can I ellipsis text after 2 lines?
    Ahmet Can Güven
    @Acanguven

    I just made my project Rapidash public today. It is a utility library to provide features like Lodash. But, it builds its own bundle based on benchmark results of submitted solutions of open source community. Each contributor gets scored based on their solution speed.

    Why?
    Because creating high-quality pull requests is hard. Just because of this lots of newbies are not even trying to contribute open-source projects. But with Rapidash every solution that passes tests is accepted. You will also get scored based on your solutions ops/sec. With a little bit gamification, I believe we can courage people into more open-source projects.

    Please check out the repo and the website, I am looking for feedbacks.
    https://github.com/Acanguven/rapidash

    Thorsten Kötzsch
    @thorstenkoetzsch_gitlab

    Good morning guys, at the moment I’m developing a „Gutenberg-Block“ for my WordPress Environment using ReactJS. I have got a problem with sharing „props“ to my SelectControl.

    const MySelectControl = (props) => withState({
        chart: "0“,
    })(({chart, setState, props}) => (
        <SelectControl
            label="Bitte wählen Sie ein Diagramm aus: "
            value={chart}
            options={props.options}
            onChange={(chart) => {
                setState({chart})
            }}
        />
    ));

    At the moment I miss the forest for the trees. How can I share the props from line 1 to line 3? Thank you :-)

    Trevor Waddell
    @trevwaddell
    Thoughts on using 1 reducer and one action type to manage the state of an entire application?
    Eric
    @sliceofbytes
    @rolong_gitlab usually you would fallback to some form of socket communication for that
    so the server can tell the client when the long running operation has completed
    @trevwaddell would almost defeat the purpose of using state management
    @saeedjassani you would need to use a custom component to ellipsis on the 2nd line. Or if you only care about webkit browsers you can use the line-clamp css
    Thomas Sieverding
    @Bajix
    Why the fuck does React use immutability? Like it’s complete shit and makes it harder to work with, and the rendering performance is crap compared to change propagation. I don’t get it; this just seems like unecessary complex trash
    I could understand if it were for some performance gain, but then they go and use vdom differing and squander any performance gains that could be made
    Eric
    @sliceofbytes
    It makes it a lot easier to tell if your state has changed when you can do by val comparisons
    Many arguments could be made for immutable state even if that state is not as performant
    Thomas Sieverding
    @Bajix
    @sliceofbytes it doesn’t actually make it easier to tell if the state has changed though; that’s a fallacy - it introduces the need to tell if the state has changed and then proposes a less-bad comparison system when this could all have been done by simply observing changes
    Coming from CanJS, so much of what I see in React is horrific… it’s neither simpler nor more performant
    Eric
    @sliceofbytes
    To each their own I guess
    Sasha Shpota
    @Shpota

    I created a GraphQL-based Web App with React, Go and MongoDB. It's a good starting point if you want to use these technologies (included a detailed how-to guide). I hope you'll find it useful.

    https://github.com/Shpota/skmz

    Antonio Rù
    @antonioru
    Hello everyone, few weeks ago I've released a hook collection for other developers to use and speed-up their development process
    please feel free to take a look at it, fork, start, judge, whatever... :)
    Tim von Känel
    @dunky11
    I created a template for an SaaS/Admin web application using React and Material-UI. It contains a landing page, a blog, login/register area and a dashboard for logged-in users. I hope you can do something useful with it:) https://github.com/dunky11/react-saas-template
    Victor Beirão Fernandes
    @victorbf

    Hello any one here know how to improve my code? I'm using formik for setting values after changing the zip code to auto complete the fields that my api send to me

    Here the code:

    const handleZipCodeChange = debounce(async (value, index) => {
    const data = await fetchAddressData(value);
    setFieldValue(addresses[${index}].neighborhood, data.neighborhood);
    setFieldValue(addresses[${index}].city, data.city);
    setFieldValue(addresses[${index}].street_name, data.street_name);
    setFieldValue(addresses[${index}].state, data.state);
    }, 500);

    Sasha Shpota
    @Shpota

    Hi everyone,
    I created a CLI tool that helps generate Full Stack React+Go projects.
    I'll be happy to receive any kind of feedback.

    https://github.com/Shpota/goxygen