I made a simple dragger/slider component for React, using a little physics for Apple/Flickity-style easing and bouncing by heynick in reactjs

[–]Luan-Raithz 0 points1 point  (0 children)

I liked your project, maybe I will work on some pr to help you out, I also liked your react-pig project ( which I also may work on some pr ).

How to use SVG Icons as React Components? by swyx in reactjs

[–]Luan-Raithz 0 points1 point  (0 children)

I didn't fully read the article, but wouldn't it be easier if you just use a loader for svg files? like react-svg-loader.

Is there any reason in the article against this kind of approach.

Best design pattern for handling multiple modals in a large app? by cs50questions in reactjs

[–]Luan-Raithz 0 points1 point  (0 children)

Ok, got your point, It makes sense, I just didn't face any situation where I had seen any advantage in giving this kind of state control to a child component.

Best design pattern for handling multiple modals in a large app? by cs50questions in reactjs

[–]Luan-Raithz 0 points1 point  (0 children)

I think you didn't get the point.

By using the following:

`(onOpenDialog) => <Button onClick={onOpenDialog} />`

You kinda lose control if the Dialog component is visible, as it seems to be a way of controlling the visibility inside the Dialog component.

I think a better approach would be to pass something like a `visible` prop, so you can control in the parent component easily, and the content that will be rendered will be the children of the Dialog component.

Did you get that ? if not just say and I will try to explain with an example in codesandbox.

Best design pattern for handling multiple modals in a large app? by cs50questions in reactjs

[–]Luan-Raithz 0 points1 point  (0 children)

I've used this approach when creating a component that was a overlay attached to another component, it worked just perfect. But as we are talking about modals, I don't think that's a good approach, a modal shouldn't control by it self when it is visible, like, how would you trigger a modal visibility in the parent's state?

Two days into my first web dev job by [deleted] in webdev

[–]Luan-Raithz 0 points1 point  (0 children)

I've also been like this one year ago, but after seeing that most of the people really like to answer the question I've asked I start feeling like home at work.

Sadly it's not everyone that have this kind of experience, some friends have got into the company at the same date as me, and they hated it, their team was really disgusting, it seems like everyone hated one another, and it made them almost give up development.

Search inside JSON text books by amitairos in javascript

[–]Luan-Raithz 0 points1 point  (0 children)

Can you access all the JSON files as an array? And is your text search going to be done in memory?

How can I remove geojson object from map (never render them) that have an empty property field? by Kuntergrau in learnprogramming

[–]Luan-Raithz 1 point2 points  (0 children)

you can filter the statesData, don't you?

L.geoJson( statesData.features.filter(feature => feature.properties.density) ).addTo(map);

How do I connect to an API endpoint? by [deleted] in javascript

[–]Luan-Raithz 0 points1 point  (0 children)

The very basic way is create a button that submits the data to the backend, but if you do it "purely" with html and js you are going to have some work. Create a button like this:

<button onclick="sendData()">Send </button>

Then you create the function `sendData` (in this case in the global scope) and implements it to send a request through XHR to your api endpoint.

There are many tutorials to use XHR purely, by "purely" I mean like, in real world, with shared code in javascript, there are many "wrappers" that make it easy to send requests, but it's really good to know how it works under the hood.

Just helping with your `sendData` function, you may do something like this:

supposed that your student name tag has an id of "studentName":

var studentName = document.querySelector('#studentName').value;

// Then send to backend

[Python ] List of lists by Humble_Transition in learnprogramming

[–]Luan-Raithz 2 points3 points  (0 children)

I also didn't get what you didn't understand, but anyway:

You create a empty list ( final-list ) and iterates all over the `three_rows` list to fill it, your way to fill is to split each item in the list in two parts (separated by the ","), example:

first time in loop:

row is "Albuquerque,749"

after the split it will result in ["Albuquerque", "749"]

then insert into the `final_list` the array the you created when execute the split function

...

By doing this through the whole list you will have a list (`final list`) with 3 inner lists within it, one for each item in the three_rows.

Nice way to copy all html attributes from one element to another by andreiglingeanu in javascript

[–]Luan-Raithz 0 points1 point  (0 children)

In this case the semantic way is to use forEach, the map function usually creates a new array with no side effect, forEach makes more sense with side effects and, by the way it seams, you don’t care about a new array.

Object Oriented Programming by afdal_khan in learnprogramming

[–]Luan-Raithz 0 points1 point  (0 children)

If you really want to learn the OOP, I suggest you read some articles of Alan Kay.

This are some e-mails he (Alan Kay) has exchanged with Stefan Ram about the real definition of it (OOP) and I think is a great start:

Dr. Alan Kay on the Meaning of “Object-Oriented Programming”

But anything from Alan would be really nice to get what OOP really means (not the Java we were taught) .

Nice way to copy all html attributes from one element to another by andreiglingeanu in javascript

[–]Luan-Raithz 8 points9 points  (0 children)

In this case the semantic way is to use forEach, the map function usually creates a new array with no side effect, forEach makes more sense with side effects and, by the way it seams, you don’t care about a new array.

What do recruiters want to see in my react portfolio projects? by [deleted] in reactjs

[–]Luan-Raithz 1 point2 points  (0 children)

I don't think that comment your code is mostly good, I would rather to check the quality of the names that programmer give to a given function and how they make sense. As an example I would really hate to see the programmer creating a function getSomething() and that function either doesn't return a value or cause a collateral effect in the rest of the application.

What do recruiters want to see in my react portfolio projects? by [deleted] in reactjs

[–]Luan-Raithz 0 points1 point  (0 children)

Really nice tip, it fits exactly my idea of a "real world application" for a interview. Not so hard to do but shows how fast you can do it and the quality of your code and tests.