react-basic-component
v1.0.5
Published
react-basic-component React component
Downloads
6
Readme
react-basic-component
Describe react-basic-component here.
#input this.props = { webStorage: { sessionData: 'sessionData', localStorageData: 'localStorageData', cookiesData: 'cookiesData' }, apiUrl: 'https://jsonplaceholder.typicode.com/posts', onSetWebStorage: this.onSetWebStorage } #include component - ReactDOM.render(React.createElement(ReactBasicComponent, this.props), document.getElementById('react-id'));
#Method This need to be initialize to set the web storage
onSetWebStorage = (storage) => { if (storage.localStorageData !== '') { localStorage.setItem('localStorageData', storage.localStorageData); } if (storage.sessionData !== '') { sessionStorage.setItem('sessionData', storage.sessionData); } if (storage.sessionData !== '') { cookie.save('cookieData', storage.cookiesData); } }
#Use Javascript get,set Method -import jsMethod from './javascript-function'; setUserInfo - to set user name '{ user: username }' resetUser - reset getUserDetails- get user name
#pass template if we pass template it will show that template. other wise use default template Volvo Saab Fiat Audi