<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nar Zantaria</title>
    <description>The latest articles on DEV Community by Nar Zantaria (@narzantaria).</description>
    <link>https://dev.to/narzantaria</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F189882%2F216c4339-1aae-4652-822e-170300b443c2.jpg</url>
      <title>DEV Community: Nar Zantaria</title>
      <link>https://dev.to/narzantaria</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/narzantaria"/>
    <language>en</language>
    <item>
      <title>How to create and download xlsx on the client?</title>
      <dc:creator>Nar Zantaria</dc:creator>
      <pubDate>Tue, 24 Nov 2020 20:46:24 +0000</pubDate>
      <link>https://dev.to/narzantaria/how-to-create-and-download-xlsx-on-the-client-42o6</link>
      <guid>https://dev.to/narzantaria/how-to-create-and-download-xlsx-on-the-client-42o6</guid>
      <description>&lt;p&gt;Can you please tell me if this code can be simplified, or is it done correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Fragment } from 'react';
import xlsx from 'node-xlsx';
import download from 'downloadjs';

function TableDownload({ data }) {
  return (
    &amp;lt;Fragment&amp;gt;
      &amp;lt;button onClick={_ =&amp;gt; {
        const qwerty = [[1, 2, 3], ['a', 'b', 'c']];
        let buffer = xlsx.build([{ name: "mySheetName", data: qwerty }]).toString('base64');
        download(atob(buffer), 'data.xlsx', { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
      }}&amp;gt;12345&amp;lt;/button&amp;gt;
    &amp;lt;/Fragment&amp;gt;
  );
}

export default TableDownload;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything happens on the client side: a file is created, which is then downloaded, without reloading the page. The data is first converted to the "base64" string and then decoded. Everything works, but I want the code to be "in line with tradition", and there was nothing superfluous in it.&lt;/p&gt;

&lt;p&gt;Regards.&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Are there any other options for implementing SEO in the Node / Vue project, other than Nuxt JS?</title>
      <dc:creator>Nar Zantaria</dc:creator>
      <pubDate>Sat, 20 Jul 2019 04:45:09 +0000</pubDate>
      <link>https://dev.to/narzantaria/are-there-any-other-options-for-implementing-seo-in-the-node-vue-project-other-than-nuxt-js-jl8</link>
      <guid>https://dev.to/narzantaria/are-there-any-other-options-for-implementing-seo-in-the-node-vue-project-other-than-nuxt-js-jl8</guid>
      <description>&lt;p&gt;Hello!&lt;br&gt;
I'm going to work with backend in a Node/Vue project. Tell me, please, what are the options for implementing a SEO other than Nuxt JS?&lt;br&gt;
I usually worked with a Node / React stack and more familiar with Next JS, which is restricted to React.&lt;br&gt;
Can you please tell some alternative options?&lt;br&gt;
Thanks for any help!&lt;/p&gt;

</description>
      <category>node</category>
    </item>
    <item>
      <title>How to change form inputs in React and post using axios?</title>
      <dc:creator>Nar Zantaria</dc:creator>
      <pubDate>Mon, 15 Jul 2019 06:22:14 +0000</pubDate>
      <link>https://dev.to/narzantaria/how-to-change-form-inputs-in-react-and-post-using-axios-14oa</link>
      <guid>https://dev.to/narzantaria/how-to-change-form-inputs-in-react-and-post-using-axios-14oa</guid>
      <description>&lt;p&gt;Hi there!&lt;/p&gt;

&lt;p&gt;I'm learning React, but not strong yet. I use a component with form, that recieve data from express backend using axios. &lt;br&gt;
There is no problems with get the correct data and render it in the form inputs, but i can't cope how to change input values and post using axios. I read something about handleChange() and other staff, but it's too hard yet. &lt;/p&gt;

&lt;p&gt;The JSON looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "data": [
        {
            "_id": "5d28a6fcec97b111c2f5867d",
            "phone": "+1 (111) 111 11 11",
            "email": "shutruk@gmail.com",
            "title": "khkjhkjhkj",
            "longTitle": "lkjlkjlkjlk",
            "introTitle": "Shutruk",
            "introLongTitle": "Shutruk-Nahhunte",
            "videoLink": "khkjhkjhkj",
            "introText": "lkjlkjlkjlk",
            "__v": 0
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here is the component:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Component } from 'react';
import axios from 'axios';

class Misc extends Component {
  state = {
    data: [],
    loading: true,
    error: false,
  }
  componentDidMount() {
    axios.get('http://localhost:5555/data')
      .then(res =&amp;gt; {
        const data = res.data.data; // get the data array instead of object
        this.setState({ data, loading: false });
        console.log(data);
      })
      .catch(err =&amp;gt; { // log request error and prevent access to undefined state
        this.setState({ loading: false, error: true });
        console.error(err); 
      })
  }
  render() {
    if (this.state.loading) {
      return(
        &amp;lt;div&amp;gt;
          &amp;lt;p&amp;gt; Loading... &amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }
    if (this.state.error || !this.state.data[0]) { // if request failed or data is empty don't try to access it either
      return(
        &amp;lt;div&amp;gt;
          &amp;lt;p&amp;gt; An error occured &amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }
    return (
      &amp;lt;form action=""&amp;gt;
        &amp;lt;h2 className="center" &amp;gt;Change data&amp;lt;/h2&amp;gt;
        &amp;lt;div className="center"&amp;gt;&amp;lt;img src={require('../img/orn.png')} alt="" className="orn"/&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;h5&amp;gt;Phone:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].phone } /&amp;gt;
        &amp;lt;h5&amp;gt;Email:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].email } /&amp;gt;
        &amp;lt;h5&amp;gt;Title:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].title }/&amp;gt;
        &amp;lt;h5&amp;gt;Longtitle:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].longTitle }/&amp;gt;
        &amp;lt;h2 className="center" &amp;gt;Intro:&amp;lt;/h2&amp;gt;
        &amp;lt;div className="center"&amp;gt;&amp;lt;img src={require('../img/orn.png')} alt="" className="orn"/&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;h5&amp;gt;Title:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].introTitle } /&amp;gt;
        &amp;lt;h5&amp;gt;Longtitle:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].introLongTitle } /&amp;gt;
        &amp;lt;h5&amp;gt;Link to video:&amp;lt;/h5&amp;gt;
        &amp;lt;input type="text" value={ this.state.data[0].videoLink } /&amp;gt;        
        &amp;lt;h5&amp;gt;Text:&amp;lt;/h5&amp;gt;
        &amp;lt;textarea name="" id="" cols="30" rows="10" value={ this.state.data[0].introText }&amp;gt;&amp;lt;/textarea&amp;gt;
        &amp;lt;button type="submit" className="btn-large waves-effect waves-light xbutton"&amp;gt;Save&amp;lt;/button&amp;gt;
      &amp;lt;/form&amp;gt;
    );
  }
}

export default Misc;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Many many thanks for any help!))&lt;/p&gt;

</description>
      <category>react</category>
    </item>
  </channel>
</rss>
