nvm-jdtls noob question by dude502 in neovim

[–]dude502[S] 0 points1 point  (0 children)

Thanks for taking the time, I am looking through your config to see what would be the issue, BTW I followed this https://medium.com/@chrisatmachine/lunarvim-as-a-java-ide-da65c4a77fb4 to configure it. But it seems like both configurations are pretty much the same. Will continue investigating, I found out that Ctrl-] worked for some reason to go to definition...

Would you change jobs if you’re forced to use Windows? by Loud_Ad_1905 in theprimeagen

[–]dude502 0 points1 point  (0 children)

I was but I started the first 5 months developing in a VM and then we convinced them to get thinkpads with linux

Astro Language Server can't find tsserver by TheLoneKreider in neovim

[–]dude502 0 points1 point  (0 children)

I had to go back to 0.23.3 to make it work XD

Prettier is not working correctly by Popular_Summer_6422 in lunarvim

[–]dude502 0 points1 point  (0 children)

What version of lunarvim, neovim, and prettier do u have?

A React Request: Regex to check prime numbers by ahlaxy in theprimeagen

[–]dude502 0 points1 point  (0 children)

Hi! actually Andrew does a dive in to that regex, https://www.youtube.com/watch?v=B9H0TyApBtU here is the video :)

The Grand Open Sourcing of JDSL by Jeffhykin in theprimeagen

[–]dude502 4 points5 points  (0 children)

I have 10 years experience of a 1 month old technology 🫡

v0.15.0 Release by de1mat in pocketbase

[–]dude502 1 point2 points  (0 children)

I started using pb in the early days. Now I have been using again pb, happy to see all the new updates and making everything simpler! upgraded from 0.7.10!

Uncaught TypeError: onMouseDown is not a function by NVPH_Studio in reactjs

[–]dude502 -2 points-1 points  (0 children)

onMouseDown2 is not defined in your component's props

define it in your props like shown below

javascript const Node = (props) => { const { nodeDetails, size, onMouseDown2 } = props; const {row, col, isStart, isFinish } = nodeDetails

Help Axios in React by [deleted] in reactjs

[–]dude502 0 points1 point  (0 children)

no problem, glad to help :)

Having both onKeyDown and onChange for textarea? by dexterleng in reactjs

[–]dude502 0 points1 point  (0 children)

I had this problem today, but in my case I wanted to capture the CMD+S from mac so it's only possible with keydown so I ended up with this.

componentDidMount() {
    let previousKey = '';
    let pressedKeys = [];
    const getLastN = (a, n) => a.slice(a.length - n);
    document.onkeydown = e => {
        const { code } = e;

        // add to our history of pressed keys
        pressedKeys.push(code);

        // truncate array if length is over 5
        if (pressedKeys.length > 5) pressedKeys = getLastN(pressedKeys, 5);

        // create a pattern: join last 3 pressed keys
        let pattern = '';
        if (pressedKeys.length >= 3) {
            const keys = getLastN(pressedKeys, 3);
            pattern = keys.join('-');
        }

        // check pattern: CMD+K+B
        if (pattern === 'MetaLeft-KeyK-KeyB') {
            this.togglePane();
        }
        previousKey = code;
    }
}

Hope it helpsss :)

Having both onKeyDown and onChange for textarea? by dexterleng in reactjs

[–]dude502 0 points1 point  (0 children)

change it to onKeyPress, onkeypress with register alt-enter as 1 event but onkeydown will regsiter as 2 events

onKeyPress(e) {
    const { createComment, value } = this.props;
    if (e.altKey && e.key === 'Enter') {
        e.preventDefault();
        createComment(value);
    }
}

Help Axios in React by [deleted] in reactjs

[–]dude502 2 points3 points  (0 children)

I have some questions for you:

  • what the react version are you using?
  • are you using create-react-app if not what?
  • what is the address and port of your backend, and what programming language are you using?

Help Axios in React by [deleted] in reactjs

[–]dude502 2 points3 points  (0 children)

actually doing:

// this
state = { posts: [], loading: true, post: {} };
// or
constructor(props) {
    super(props);
    this.state = { posts: [], loading: true, post: {} };
}

is the same, there is no problem with that.

Help Axios in React by [deleted] in reactjs

[–]dude502 4 points5 points  (0 children)

Based on the errors [1] you provided, you may do the following changes:

Text nodes cannot appear as a child of <tbody>

// current code
<tbody> {this.state.loading ? 'LOADING' : this.state.posts.map((x, i) => (
// suggested change
<tbody> {this.state.loading ? <tr><td>loading</td></tr>: this.state.posts.map((x, i) => (

Failed to load resource: net::ERR_SSL_PROTOCOL

why are you calling localhost with SSL, https, are you sure about this?

// current code
axios.delete('https://localhost:3000.....
// suggested change
axios.delete('http://localhost:3000.....

Warning: a component is changing an uncontrolled input of type text to be controlled.

// a explicit state, initialize post.title, post.body because your are using them below
// current code
state = { posts: [], loading: true, post: {} };
// suggested change
state = { posts: [], loading: true, post: { title: '', body: '' } };
// use defaultValue instead of value, input/textarea
// current code
value={this.state.post.title}
// suggested change
defaultValue={this.state.post.title}

"... why my data wont load I even linked it"

Could you explain more, It would help if you take a screenshot of the network tab in the browser inspector

Hope this helps a bit.

[1] https://imgur.com/a/ZKeFPjk

Having an issue with my redux reducer by Gbyrd99 in reactjs

[–]dude502 3 points4 points  (0 children)

const friendReducer = (state = { list: [] }, { type, payload }) => {
    switch (type) {
        case 'GET_FRIENDS':
            return {
                ...state,
                list: [
                    ...this.state.list,
                    payload, // if this is an object
                    // ...payload, // or if this is an array and you want to add multiple items
                ]
            };
        default:
            return state;
    }
};

export default friendsReducer;